diff options
author | Gard Spreemann <gspreemann@gmail.com> | 2019-02-05 13:53:14 +0100 |
---|---|---|
committer | Gard Spreemann <gspreemann@gmail.com> | 2019-02-05 13:53:14 +0100 |
commit | 4c8c58a8e322dbbbdb2866264394c1612c066cf9 (patch) | |
tree | 3b0deb1506bce25be476d52666d48055826de620 /src/gui/nodeitem.cpp | |
parent | 799a6929490db3a642d817dd61a3c2a9e3891156 (diff) | |
parent | 3a4a7e8b5e34e101a4ba7468fcd09d88977ca25c (diff) |
Merge tag 'v2.1.4' into debian/sid
Diffstat (limited to 'src/gui/nodeitem.cpp')
-rw-r--r-- | src/gui/nodeitem.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index 78fe66e..82692f2 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -19,6 +19,7 @@ #include "tikzit.h" #include "nodeitem.h" #include "tikzscene.h" +#include "util.h" #include <cmath> #include <QPen> @@ -50,7 +51,7 @@ void NodeItem::writePos() } QRectF NodeItem::labelRect() const { - QString label = _node->label(); + QString label = replaceTexConstants(_node->label()); QFontMetrics fm(Tikzit::LABEL_FONT); QRectF rect = fm.boundingRect(label); rect.moveCenter(QPointF(0,0)); @@ -58,7 +59,7 @@ QRectF NodeItem::labelRect() const { } QRectF NodeItem::outerLabelRect() const { - QString label = _node->data()->property("label"); + QString label = replaceTexConstants(_node->data()->property("label")); label.replace(QRegularExpression("^[^:]*:"), ""); QFontMetrics fm(Tikzit::LABEL_FONT); QRectF rect = fm.boundingRect(label); @@ -102,11 +103,11 @@ void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge painter->setPen(QPen(Qt::black)); painter->setFont(Tikzit::LABEL_FONT); - painter->drawText(rect, Qt::AlignCenter, _node->label()); + painter->drawText(rect, Qt::AlignCenter, replaceTexConstants(_node->label())); } if (_node->data()->hasProperty("label")) { - QString label = _node->data()->property("label"); + QString label = replaceTexConstants(_node->data()->property("label")); label.replace(QRegularExpression("^[^:]*:"), ""); QRectF rect = outerLabelRect(); |