diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2018-09-11 10:40:21 +0200 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2018-09-11 10:40:21 +0200 |
commit | 5708cb51035cfd40692afd308fb2bf326528b885 (patch) | |
tree | f390f3f7e95046a2429b41873dac5024b378cda3 | |
parent | 4417ac396302b1ba28985238a2b6993a161f464a (diff) |
nodeitem respects shape
-rw-r--r-- | src/gui/nodeitem.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/nodeitem.cpp b/src/gui/nodeitem.cpp index b452848..18ff43c 100644 --- a/src/gui/nodeitem.cpp +++ b/src/gui/nodeitem.cpp @@ -114,7 +114,12 @@ void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidge QPainterPath NodeItem::shape() const { QPainterPath path; - path.addEllipse(QPointF(0,0), GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); + + if (_node->style()->shape() == "rectangle") { + path.addRect(-0.2 * GLOBAL_SCALEF, -0.2 * GLOBAL_SCALEF, 0.4 * GLOBAL_SCALEF, 0.4 * GLOBAL_SCALEF); + } else { + path.addEllipse(QPointF(0, 0), GLOBAL_SCALEF * 0.2, GLOBAL_SCALEF * 0.2); + } return path; } |