aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/defconQt/glyphView.py5
-rw-r--r--Lib/defconQt/representationFactories/glyphViewFactory.py16
2 files changed, 13 insertions, 8 deletions
diff --git a/Lib/defconQt/glyphView.py b/Lib/defconQt/glyphView.py
index 1e05a99..88073ae 100644
--- a/Lib/defconQt/glyphView.py
+++ b/Lib/defconQt/glyphView.py
@@ -1284,8 +1284,9 @@ class GlyphView(QGraphicsView):
scene._outlineItem.setZValue(-995)
scene._glyphObject = self._glyph
# components
- path = self._glyph.getRepresentation("defconQt.OnlyComponentsQPainterPath")
- scene.addPath(path, brush=QBrush(componentFillColor))
+ paths = self._glyph.getRepresentation("defconQt.OnlyComponentsQPainterPath")
+ for path in paths:
+ scene.addPath(path, brush=QBrush(componentFillColor))
def addPoints(self):
scene = self.scene()
diff --git a/Lib/defconQt/representationFactories/glyphViewFactory.py b/Lib/defconQt/representationFactories/glyphViewFactory.py
index fe5183d..1b96cdc 100644
--- a/Lib/defconQt/representationFactories/glyphViewFactory.py
+++ b/Lib/defconQt/representationFactories/glyphViewFactory.py
@@ -29,15 +29,17 @@ class NoComponentsQtPen(QtPen):
def OnlyComponentsQPainterPathFactory(glyph, font):
pen = OnlyComponentsQtPen(font)
glyph.draw(pen)
- pen.path.setFillRule(Qt.WindingFill)
- return pen.path
+ return pen.getData()
class OnlyComponentsQtPen(BasePen):
def __init__(self, glyphSet):
BasePen.__init__(self, glyphSet)
- self.pen = QtPen(glyphSet)
- self.path = self.pen.path
+ self._glyphSet = glyphSet
+ self.paths = []
+
+ def getData(self):
+ return self.paths
def _moveTo(self, p):
pass
@@ -57,9 +59,11 @@ class OnlyComponentsQtPen(BasePen):
except KeyError:
return
else:
- tPen = TransformPen(self.pen, transformation)
+ pen = QtPen(self._glyphSet)
+ pen.path.setFillRule(Qt.WindingFill)
+ tPen = TransformPen(pen, transformation)
glyph.draw(tPen)
-
+ self.paths.append(pen.path)
# ----------
# point data