aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrien Tétar2015-09-09 20:48:49 +0200
committerAdrien Tétar2015-09-09 20:48:49 +0200
commit0bb4ff790776350fbd728fe7a960fd903f703472 (patch)
tree36b345b309ac1789048f7db482773a35209f203b
parentd925d69e39c888dd3be46cc19b212c8a1d22659e (diff)
downloadtrufont-0bb4ff790776350fbd728fe7a960fd903f703472.tar.bz2
spaceCenter: add padding for the right boundary as well
-rw-r--r--Lib/defconQt/spaceCenter.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/defconQt/spaceCenter.py b/Lib/defconQt/spaceCenter.py
index d2ff22d..8194a7b 100644
--- a/Lib/defconQt/spaceCenter.py
+++ b/Lib/defconQt/spaceCenter.py
@@ -470,14 +470,13 @@ class GlyphsCanvas(QWidget):
if self._showMetrics: paintLineMarks(painter)
for index, glyph in enumerate(self.glyphs):
# line wrapping
- # TODO: should padding be added for the right boundary as well? I'd say no but not sure
gWidth = glyph.width*self.scale
doKern = index > 0 and self._showKerning and cur_width > 0
if doKern:
kern = self.lookupKerningValue(self.glyphs[index-1].name, glyph.name)*self.scale
else: kern = 0
- if self._wrapLines and cur_width + gWidth + kern + self.padding > self.width():
- painter.translate(-cur_width, self.ptSize)
+ if self._wrapLines and cur_width + gWidth + kern + 2*self.padding > self.width():
+ painter.translate(-cur_width, self.ptSize*self._lineHeight)
if self._showMetrics: paintLineMarks(painter)
self._positions.append([(0, gWidth)])
cur_width = gWidth