From 8284e99ac7ee32f6c3b9ddff8fa291be2eef4da3 Mon Sep 17 00:00:00 2001 From: Adrien Tétar Date: Fri, 9 Oct 2015 19:07:30 +0200 Subject: glyphView: fixed bug that could collapse both offCurves in a smooth point --- Lib/defconQt/glyphView.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Lib/defconQt/glyphView.py') 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) -- cgit v1.2.3