summaryrefslogtreecommitdiff
path: root/src/data
diff options
context:
space:
mode:
authorAleks Kissinger <aleks0@gmail.com>2019-01-11 08:50:02 +0100
committerAleks Kissinger <aleks0@gmail.com>2019-01-11 08:50:02 +0100
commit6db2bfd256d2c409f0223bf2685a2829466add78 (patch)
treedc502da1f776d354b77b1c67ac620a32f3f66003 /src/data
parent0002340da590611f635775d0555c66c7f22db09c (diff)
keep inAngle and outAngle snapped to 15-degree increments
Diffstat (limited to 'src/data')
-rw-r--r--src/data/edge.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/data/edge.cpp b/src/data/edge.cpp
index 41fc2bb..fcd9959 100644
--- a/src/data/edge.cpp
+++ b/src/data/edge.cpp
@@ -169,8 +169,10 @@ void Edge::updateControls() {
qreal bnd = static_cast<qreal>(_bend) * (M_PI / 180.0);
outAngleR = angle - bnd;
inAngleR = M_PI + angle + bnd;
- _outAngle = static_cast<int>(round(outAngleR * (180.0 / M_PI)));
- _inAngle = static_cast<int>(round(inAngleR * (180.0 / M_PI)));
+
+ // keep _inAngle and _outAngle snapped to increments of 15 degrees
+ _outAngle = static_cast<int>(roundToNearest(15.0, outAngleR * (180.0 / M_PI)));
+ _inAngle = static_cast<int>(roundToNearest(15.0, inAngleR * (180.0 / M_PI)));
} else {
outAngleR = static_cast<qreal>(_outAngle) * (M_PI / 180.0);
inAngleR = static_cast<qreal>(_inAngle) * (M_PI / 180.0);