diff options
author | Gard Spreemann <gspr@nonempty.org> | 2020-08-20 09:03:17 +0200 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2020-08-20 09:03:17 +0200 |
commit | 4e1b4e9877732d1e1887674e48312902437f08c5 (patch) | |
tree | 7993cbc3ad71eed10da830aca85ef0b99d163bac /src/gui/undocommands.h | |
parent | 99f00a3ef9d1bd2d686b1521d25c9afedb880b34 (diff) | |
parent | 300267089b80785551c4721684280efe654ec834 (diff) |
Merge tag 'v2.1.6' into debian/sid
Diffstat (limited to 'src/gui/undocommands.h')
-rw-r--r-- | src/gui/undocommands.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gui/undocommands.h b/src/gui/undocommands.h index 40f0a3b..c10eecc 100644 --- a/src/gui/undocommands.h +++ b/src/gui/undocommands.h @@ -255,4 +255,35 @@ private: QVector<Edge*> _newEdgeOrder; }; +class MakePathCommand : public GraphUpdateCommand +{ +public: + explicit MakePathCommand(TikzScene *scene, + const QVector<Edge*> &edgeList, + const QMap<Edge*,GraphElementData*> &oldEdgeData, + QUndoCommand *parent = nullptr); + void undo() override; + void redo() override; +private: + QVector<Edge*> _edgeList; + + // creating path clobbers data on all but first edge + QMap<Edge*,GraphElementData*> _oldEdgeData; +}; + +class SplitPathCommand : public GraphUpdateCommand +{ +public: + explicit SplitPathCommand(TikzScene *scene, + const QSet<Path*> &paths, + QUndoCommand *parent = nullptr); + void undo() override; + void redo() override; +private: + QSet<Path*> _paths; + + // keep a copy of the edge lists so they can be added back to each path in undo() + QMap<Path*,QVector<Edge*>> _edgeLists; +}; + #endif // UNDOCOMMANDS_H |