Ignore:
Timestamp:
Apr 23, 2021, 9:02:12 PM (5 years ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.0, stable
Children:
0fbea3
Parents:
5061d9
git-author:
Frederik Heber <frederik.heber@…> (04/06/21 20:09:39)
git-committer:
Frederik Heber <frederik.heber@…> (04/23/21 21:02:12)
Message:

Added UndoMarkAction.

NOTE: This action is necessary as not all actions are actually recorded
in the history. For example, the UndoAction is an action that is not
pushed into the history deque and also must not as further undos would
then become impossible. There are other actions that just do output
or similar things that do not change the state.
This makes it impossible to undo back to a certain state by blindly
counting actions as one cannot know from the outside whether an action
is stateless or not.

undoing till the set mark.

  • TESTS: added regression test case on undo-mark.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionHistory.hpp

    r5061d9 r0ec9f5  
    4343  bool hasRedo();
    4444
     45  void setMark();
     46  void unsetMark();
     47  void undoTillMark();
     48
    4549  void addElement(Action*,ActionState::ptr);
    4650  void clear();
     
    4953  std::deque<HistoryElement> history;
    5054  std::deque<HistoryElement> yrotsih;
     55
     56  //!> marks a specific state in the history to allow undoing directly till that
     57  HistoryElement * mark;
    5158
    5259public:
Note: See TracChangeset for help on using the changeset viewer.