diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2020-04-10 15:09:02 +0100 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2020-04-10 15:09:02 +0100 |
commit | f17f2a4f902fed525b6a47f4be68a2e10f51b227 (patch) | |
tree | 293751835cdfab320be8887ad308d49c293925d8 /src/gui/nodeitem.cpp | |
parent | d680579952d758eb7457e688cb80ec8ead0086e1 (diff) |
toggle show node labels from View menu (closes #62)
Diffstat (limited to 'src/gui/nodeitem.cpp')
-rw-r--r-- | src/gui/nodeitem.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index 82692f2..7ae4c4a 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -91,7 +91,13 @@ void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->drawPath(shape()); } - if (_node->label() != "") { + bool drawLabel = _node->label() != ""; + if (scene()) { + TikzScene *sc = static_cast<TikzScene*>(scene()); + drawLabel= drawLabel && sc->drawNodeLabels(); + } + + if (drawLabel) { QRectF rect = labelRect(); QPen pen(QColor(200,0,0,120)); QVector<qreal> d; |