From: Marius Gedminas <marius@gedmin.as>
... | ... |
@@ -125,6 +125,8 @@ class TextShape(Shape): |
125 | 125 |
else: |
126 | 126 |
cr.update_layout(layout) |
127 | 127 |
|
128 |
+ descent = 2 # XXX get descender from font metrics |
|
129 |
+ |
|
128 | 130 |
width, height = layout.get_size() |
129 | 131 |
width = float(width)/pango.SCALE |
130 | 132 |
height = float(height)/pango.SCALE |
... | ... |
@@ -135,11 +137,10 @@ class TextShape(Shape): |
135 | 137 |
f = self.w / width |
136 | 138 |
width = self.w # equivalent to width *= f |
137 | 139 |
height *= f |
140 |
+ descent *= f |
|
138 | 141 |
else: |
139 | 142 |
f = 1.0 |
140 | 143 |
|
141 |
- descent = 2 # XXX get descender from font metrics |
|
142 |
- |
|
143 | 144 |
if self.j == self.LEFT: |
144 | 145 |
x = self.x |
145 | 146 |
elif self.j == self.CENTER: |