From 2c5b4b82ca816532c8366db762c9bcec8849623d Mon Sep 17 00:00:00 2001 From: Adrien Tétar Date: Fri, 9 Oct 2015 19:36:52 +0200 Subject: glyphView: show the whole glyph upon opening --- Lib/defconQt/glyphView.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Lib/defconQt/glyphView.py') diff --git a/Lib/defconQt/glyphView.py b/Lib/defconQt/glyphView.py index c96a4f1..49f34ab 100644 --- a/Lib/defconQt/glyphView.py +++ b/Lib/defconQt/glyphView.py @@ -1357,9 +1357,7 @@ class GlyphView(QGraphicsView): def addBlues(self): scene = self.scene() - #width = self._glyph.width# * self._inverseScale font = self._glyph.getParent() - #painter.setCompositionMode(QPainter.CompositionMode_SourceOver) if font is None: return attrs = ["postscriptBlueValues", "postscriptOtherBlues"] @@ -1564,6 +1562,11 @@ class GlyphView(QGraphicsView): self.parent().setWindowTitle(self._glyph.name, self._glyph.getParent()) self.redrawGlyph() + def showEvent(self, event): + super(GlyphView, self).showEvent(event) + font = self._glyph.getParent() + self.fitInView(0, font.info.descender, self._glyph.width, font.info.unitsPerEm, Qt.KeepAspectRatio) + def mousePressEvent(self, event): if (event.button() == Qt.MidButton): dragMode = self.dragMode() -- cgit v1.2.3