summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/tikzscene.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/tikzscene.cpp b/src/gui/tikzscene.cpp
index b2c5fd7..119d0d1 100644
--- a/src/gui/tikzscene.cpp
+++ b/src/gui/tikzscene.cpp
@@ -556,7 +556,8 @@ void TikzScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
}
break;
case ToolPalette::EDGE:
- if (_edgeStartNodeItem != 0 && _edgeEndNodeItem != 0) {
+ // add an edge. Currently, self-loops are not supported (since they aren't drawn properly)
+ if (_edgeStartNodeItem != 0 && _edgeEndNodeItem != 0 && _edgeStartNodeItem != _edgeEndNodeItem) {
Edge *e = new Edge(_edgeStartNodeItem->node(), _edgeEndNodeItem->node(), _tikzDocument);
e->setStyleName(_styles->activeEdgeStyleName());
AddEdgeCommand *cmd = new AddEdgeCommand(this, e);