summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/tikzscene.cpp5
-rw-r--r--src/gui/undocommands.cpp4
2 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp
index 001ab40..9eee2fc 100644
--- a/src/gui/tikzscene.cpp
+++ b/src/gui/tikzscene.cpp
@@ -90,14 +90,15 @@ void TikzScene::graphReplaced()
_edgeItems.clear();
foreach (Edge *e, graph()->edges()) {
- e->attachStyle();
+ //e->attachStyle();
+ //e->updateControls();
EdgeItem *ei = new EdgeItem(e);
_edgeItems.insert(e, ei);
addItem(ei);
}
foreach (Node *n, graph()->nodes()) {
- n->attachStyle();
+ //n->attachStyle();
NodeItem *ni = new NodeItem(n);
_nodeItems.insert(n, ni);
addItem(ni);
diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp
index e2502f1..9c52bf3 100644
--- a/src/gui/undocommands.cpp
+++ b/src/gui/undocommands.cpp
@@ -421,12 +421,16 @@ ReplaceGraphCommand::ReplaceGraphCommand(TikzScene *scene, Graph *oldGraph, Grap
void ReplaceGraphCommand::undo()
{
+ foreach (Node *n, _oldGraph->nodes()) n->attachStyle();
+ foreach (Edge *e, _oldGraph->edges()) e->updateControls();
_scene->tikzDocument()->setGraph(_oldGraph);
_scene->graphReplaced();
}
void ReplaceGraphCommand::redo()
{
+ foreach (Node *n, _newGraph->nodes()) n->attachStyle();
+ foreach (Edge *e, _newGraph->edges()) e->updateControls();
_scene->tikzDocument()->setGraph(_newGraph);
_scene->graphReplaced();
}