summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2018-09-11 10:40:21 +0200
committerAleks Kissinger <aleks0@gmail.com>2018-09-11 10:40:21 +0200
commit5708cb51035cfd40692afd308fb2bf326528b885 (patch)
treef390f3f7e95046a2429b41873dac5024b378cda3 /src
parent4417ac396302b1ba28985238a2b6993a161f464a (diff)
nodeitem respects shape
Diffstat (limited to 'src')
-rw-r--r--src/gui/nodeitem.cpp7
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;
}