aboutsummaryrefslogtreecommitdiffstats
path: root/Lib/defconQt/glyphView.py
diff options
context:
space:
mode:
authorAdrien Tétar2015-10-09 19:36:52 +0200
committerAdrien Tétar2015-10-09 19:37:38 +0200
commit2c5b4b82ca816532c8366db762c9bcec8849623d (patch)
treeefe77cd66483a673a720d61f31b215b8b132c788 /Lib/defconQt/glyphView.py
parent8284e99ac7ee32f6c3b9ddff8fa291be2eef4da3 (diff)
downloadtrufont-2c5b4b82ca816532c8366db762c9bcec8849623d.tar.bz2
glyphView: show the whole glyph upon opening
Diffstat (limited to 'Lib/defconQt/glyphView.py')
-rw-r--r--Lib/defconQt/glyphView.py7
1 files changed, 5 insertions, 2 deletions
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()