summaryrefslogtreecommitdiff
path: root/src/gui/undocommands.cpp
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2020-04-18 15:30:31 +0100
committerAleks Kissinger <aleks0@gmail.com>2020-04-18 15:30:31 +0100
commitef07176e5c5c8e2aa9ea5a380000302234f2934c (patch)
treedb68c161dc6efec268b84e4c4209922294b3c718 /src/gui/undocommands.cpp
parent08ce6c91fd37c904362a5ec6f054bcd3ee061b74 (diff)
deleting works correctly with paths
Diffstat (limited to 'src/gui/undocommands.cpp')
-rw-r--r--src/gui/undocommands.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp
index 3b1109e..35345de 100644
--- a/src/gui/undocommands.cpp
+++ b/src/gui/undocommands.cpp
@@ -685,18 +685,17 @@ void MakePathCommand::redo()
}
SplitPathCommand::SplitPathCommand(TikzScene *scene,
- const QVector<Path *> &paths,
+ const QSet<Path *> &paths,
QUndoCommand *parent) :
GraphUpdateCommand(scene, parent), _paths(paths)
{
- foreach (Path *p, paths) _edgeLists << p->edges();
+ foreach (Path *p, paths) _edgeLists[p] = p->edges();
}
void SplitPathCommand::undo()
{
- for (int i = 0; i < _paths.length(); ++i) {
- Path *p = _paths[i];
- foreach (Edge *e, _edgeLists[i]) {
+ foreach (Path *p, _paths) {
+ foreach (Edge *e, _edgeLists[p]) {
p->addEdge(e);
}