summaryrefslogtreecommitdiff
path: root/src/gui/undocommands.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/undocommands.cpp')
-rw-r--r--src/gui/undocommands.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp
index a07f251..87d5a13 100644
--- a/src/gui/undocommands.cpp
+++ b/src/gui/undocommands.cpp
@@ -102,6 +102,9 @@ void EdgeBendCommand::undo()
foreach(EdgeItem *ei, _scene->edgeItems()) {
if (ei->edge() == _edge) {
ei->readPos();
+
+ Path *p = ei->edge()->path();
+ if (p) _scene->pathItems()[p]->readPos();
break;
}
}
@@ -118,6 +121,9 @@ void EdgeBendCommand::redo()
foreach(EdgeItem *ei, _scene->edgeItems()) {
if (ei->edge() == _edge) {
ei->readPos();
+
+ Path *p = ei->edge()->path();
+ if (p) _scene->pathItems()[p]->readPos();
break;
}
}
@@ -287,6 +293,9 @@ void ChangeEdgeModeCommand::undo()
// FIXME: this act strangely sometimes
_edge->setBasicBendMode(!_edge->basicBendMode());
_scene->edgeItems()[_edge]->readPos();
+ Path *p = _edge->path();
+ if (p) _scene->pathItems()[p]->readPos();
+
GraphUpdateCommand::undo();
}
@@ -294,6 +303,9 @@ void ChangeEdgeModeCommand::redo()
{
_edge->setBasicBendMode(!_edge->basicBendMode());
_scene->edgeItems()[_edge]->readPos();
+ Path *p = _edge->path();
+ if (p) _scene->pathItems()[p]->readPos();
+
GraphUpdateCommand::redo();
}
@@ -607,6 +619,12 @@ MakePathCommand::MakePathCommand(TikzScene *scene,
void MakePathCommand::undo()
{
Path *p = _edgeList.first()->path();
+
+ PathItem *pi = _scene->pathItems()[p];
+ _scene->removeItem(pi);
+ _scene->pathItems().remove(p);
+ delete pi;
+
p->removeEdges();
_scene->graph()->removePath(p);
@@ -617,6 +635,7 @@ void MakePathCommand::undo()
}
}
+ _scene->refreshZIndices();
GraphUpdateCommand::undo();
}
@@ -640,5 +659,11 @@ void MakePathCommand::redo()
_scene->graph()->addPath(p);
+ PathItem *pi = new PathItem(p);
+ _scene->addItem(pi);
+ _scene->pathItems().insert(p, pi);
+ pi->readPos();
+
+ _scene->refreshZIndices();
GraphUpdateCommand::redo();
}