10000 scale descent back · matplotlib/matplotlib@addf1ee · GitHub
[go: up one dir, main page]

Skip to content

Commit addf1ee

Browse files
committed
scale descent back
1 parent 92f2328 commit addf1ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/backends/backend_macosx.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,11 @@ def _draw_mathtext(self, gc, x, y, s, prop, angle):
130130
scale = self.gc.get_image_magnification()
131131
ox, oy, width, height, descent, image, used_characters = \
132132
self.mathtext_parser.parse(s, self.dpi*scale, prop)
133+
descent /= scale
134+
xd = descent * numpy.sin(numpy.deg2rad(angle))
135+
yd = descent * numpy.cos(numpy.deg2rad(angle))
136+
x = numpy.round(x + ox + xd)
137+
y = numpy.round(y + oy - yd)
133138
gc.draw_mathtext(x, y, angle, 255 - image.as_array())
134139

135140
def draw_text(self, gc, x, y, s, prop, angle, ismath=False, mtext=None):

0 commit comments

Comments
 (0)
0