diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2018-09-21 08:48:43 +0200 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2018-09-21 08:48:43 +0200 |
commit | 5e5a98b97871ebaa3899e2f1bf08534e32f1f983 (patch) | |
tree | a6a5f006dfc9e0e9ad429181166f5aa5ce48da23 | |
parent | afcf3dba0753d71b801fb035277b2ec857f19de9 (diff) |
fixed bug with edge styles
-rw-r--r-- | src/data/nodestyle.cpp | 1 | ||||
-rw-r--r-- | src/data/tikzdocument.cpp | 5 | ||||
-rw-r--r-- | src/gui/undocommands.cpp | 12 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp index 9c38dfd..20245d9 100644 --- a/src/data/nodestyle.cpp +++ b/src/data/nodestyle.cpp @@ -22,6 +22,7 @@ #include <QPainter>
NodeStyle *noneStyle = new NodeStyle();
+NodeStyle *unknownStyle = new NodeStyle("unknown", new GraphElementData({GraphElementProperty("tikzit fill", "red")}));
NodeStyle::NodeStyle() : Style()
{
diff --git a/src/data/tikzdocument.cpp b/src/data/tikzdocument.cpp index 5ddec90..fd70e92 100644 --- a/src/data/tikzdocument.cpp +++ b/src/data/tikzdocument.cpp @@ -85,7 +85,10 @@ void TikzDocument::open(QString fileName) delete _graph;
_graph = newGraph;
foreach (Node *n, _graph->nodes()) n->attachStyle();
- foreach (Edge *e, _graph->edges()) e->updateControls();
+ foreach (Edge *e, _graph->edges()) {
+ e->attachStyle();
+ e->updateControls();
+ }
_parseSuccess = true;
refreshTikz();
setClean();
diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 0cfa0bd..2ed5034 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -422,7 +422,10 @@ ReplaceGraphCommand::ReplaceGraphCommand(TikzScene *scene, Graph *oldGraph, Grap void ReplaceGraphCommand::undo() { foreach (Node *n, _oldGraph->nodes()) n->attachStyle(); - foreach (Edge *e, _oldGraph->edges()) e->updateControls(); + foreach (Edge *e, _oldGraph->edges()) { + e->attachStyle(); + e->updateControls(); + } _scene->tikzDocument()->setGraph(_oldGraph); _scene->graphReplaced(); } @@ -430,7 +433,10 @@ void ReplaceGraphCommand::undo() void ReplaceGraphCommand::redo() { foreach (Node *n, _newGraph->nodes()) n->attachStyle(); - foreach (Edge *e, _newGraph->edges()) e->updateControls(); + foreach (Edge *e, _newGraph->edges()) { + e->attachStyle(); + e->updateControls(); + } _scene->tikzDocument()->setGraph(_newGraph); _scene->graphReplaced(); } @@ -496,4 +502,4 @@ void RotateNodesCommand::redo() _scene->refreshAdjacentEdges(_nodes.toList()); GraphUpdateCommand::redo(); -}
\ No newline at end of file +} |