summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2018-07-20 18:26:21 +0200
committerAleks Kissinger <aleks0@gmail.com>2018-07-20 18:26:21 +0200
commit7f074813bdb2bfca2f7a9933e7c922132197aaba (patch)
tree7fad7f9c97765a96d9a820692b25a94c11642269
parenta287cd28623e8f25ead557b069a10022fae68747 (diff)
fixed .center bug when parsing tikz
-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();
}