Skip to content

Commit ef6a79e

Browse files
author
Keven Cook
committed
fixed issue with TextElement v_align top/bottom transposed
1 parent d6ed4e0 commit ef6a79e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gizeh/gizeh.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ def draw(ctx):
580580
ctx.set_font_size(fontsize)
581581
xbear, ybear, w, h, xadvance, yadvance = ctx.text_extents(txt)
582582
xshift = {"left": 0, "center": -w / 2, "right": -w}[h_align] - xbear
583-
yshift = {"bottom": 0, "center": -h / 2, "top": -h}[v_align] - ybear
583+
yshift = {"top": 0, "center": -h / 2, "bottom": -h}[v_align] - ybear
584584
new_xy = np.array(xy) + np.array([xshift, yshift])
585585
ctx.move_to(*new_xy)
586586
ctx.text_path(txt)

0 commit comments

Comments
 (0)