aboutsummaryrefslogtreecommitdiffstats
path: root/Lib/defconQt/glyphView.py
diff options
context:
space:
mode:
authorAdrien Tétar2015-10-09 19:07:30 +0200
committerAdrien Tétar2015-10-09 19:07:30 +0200
commit8284e99ac7ee32f6c3b9ddff8fa291be2eef4da3 (patch)
tree1d217eaf1cf920887fbbf60fc0666d1e8e2e15c5 /Lib/defconQt/glyphView.py
parent57f77e728c724e08a93e6c163a7f9063892b0df0 (diff)
downloadtrufont-8284e99ac7ee32f6c3b9ddff8fa291be2eef4da3.tar.bz2
glyphView: fixed bug that could collapse both offCurves in a smooth point
Diffstat (limited to 'Lib/defconQt/glyphView.py')
-rw-r--r--Lib/defconQt/glyphView.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/defconQt/glyphView.py b/Lib/defconQt/glyphView.py
index d2eac03..c96a4f1 100644
--- a/Lib/defconQt/glyphView.py
+++ b/Lib/defconQt/glyphView.py
@@ -432,8 +432,13 @@ class OnCurvePointItem(QGraphicsPathItem):
targetLen = children[selected-1].line().length()*2
else:
targetLen = children[selected-1].line().length()+children[propagate-1].line().length()
- tmpLine = QLineF(newValue, QPointF(0, 0))
- tmpLine.setLength(targetLen)
+ if not newValue.isNull():
+ tmpLine = QLineF(newValue, QPointF())
+ tmpLine.setLength(targetLen)
+ else:
+ # if newValue is null, we’d construct a zero-length line and collapse
+ # both offCurves
+ tmpLine = QLineF(QPointF(), children[propagate].pos())
children[propagate].setFlag(QGraphicsItem.ItemSendsGeometryChanges, False)
children[propagate].setPos(tmpLine.x2(), tmpLine.y2())
children[propagate].setFlag(QGraphicsItem.ItemSendsGeometryChanges)