aboutsummaryrefslogtreecommitdiffstats
path: root/Lib/defconQt/glyphView.py
diff options
context:
space:
mode:
authorFelipe Corrêa da Silva Sanches2015-09-28 22:13:40 -0300
committerAdrien Tétar2015-09-29 11:48:16 +0200
commit6b4593337cd4626b5b780d2774013063f537e793 (patch)
tree4d4546063f8ae881dc815e5ac57bd91473e0c676 /Lib/defconQt/glyphView.py
parent78dec14200f0af27cf51ebe81864226d1335bb9a (diff)
downloadtrufont-6b4593337cd4626b5b780d2774013063f537e793.tar.bz2
adding the component's outline path to the scene before creating the actual componentItem (which will only be responsible for rendering the bounding box and managing draging and updating the transformations in the defcon component object)
Diffstat (limited to 'Lib/defconQt/glyphView.py')
-rw-r--r--Lib/defconQt/glyphView.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/defconQt/glyphView.py b/Lib/defconQt/glyphView.py
index 9a8a9ca..8fd0f24 100644
--- a/Lib/defconQt/glyphView.py
+++ b/Lib/defconQt/glyphView.py
@@ -306,9 +306,8 @@ class OffCurvePointItem(QGraphicsEllipseItem):
self.setPen(QPen(offCurvePointStrokeColor, offCurvePenWidth/scale))
class ComponentItem(QGraphicsPathItem):
- def __init__(self, path, component):
- super(ComponentItem, self).__init__()
- self._pathitem = self.scene().addPath(path, brush=QBrush(componentFillColor))
+ def __init__(self, path, component, parent = None):
+ super(ComponentItem, self).__init__(parent)
self._component = component
self.setFlag(QGraphicsItem.ItemIsMovable)
self.setFlag(QGraphicsItem.ItemIsSelectable)
@@ -1324,7 +1323,8 @@ class GlyphView(QGraphicsView):
# components
scene._componentItems = []
for path, component in self._glyph.getRepresentation("defconQt.OnlyComponentsQPainterPath"):
- ci = ComponentItem(path, component)
+ pathitem = scene.addPath(path, brush=QBrush(componentFillColor))
+ ci = ComponentItem(pathitem, component)
scene.addItem(ci)
ci.setZValue(-998)
scene._componentItems.append(ci)