summaryrefslogtreecommitdiff
path: root/src/data/nodestyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/nodestyle.cpp')
-rw-r--r--src/data/nodestyle.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/data/nodestyle.cpp b/src/data/nodestyle.cpp
index aec899f..9c38dfd 100644
--- a/src/data/nodestyle.cpp
+++ b/src/data/nodestyle.cpp
@@ -45,20 +45,21 @@ QBrush NodeStyle::brush() const
return QBrush(fillColor());
}
-NodeStyle::Shape NodeStyle::shape(bool tikzitOverride) const
+QString NodeStyle::shape(bool tikzitOverride) const
{
- if (_data == 0) return NodeStyle::Circle;
-
- QString sh = propertyWithDefault("shape", "circle", tikzitOverride);
- if (sh == "circle") return NodeStyle::Circle;
- else if (sh == "rectangle") return NodeStyle::Rectangle;
- else return NodeStyle::Circle;
+ return propertyWithDefault("shape", "circle", tikzitOverride);
}
QPainterPath NodeStyle::path() const
{
QPainterPath pth;
- pth.addEllipse(QPointF(0.0f,0.0f), 30.0f, 30.0f);
+ QString sh = shape();
+
+ if (sh == "rectangle") {
+ pth.addRect(-30.0f, -30.0f, 60.0f, 60.0f);
+ } else { // default is 'circle'
+ pth.addEllipse(QPointF(0.0f,0.0f), 30.0f, 30.0f);
+ }
return pth;
}