Skip to content

Commit

Permalink
fixed issue with TextElement v_align top/bottom transposed
Browse files Browse the repository at this point in the history
  • Loading branch information
Keven Cook committed May 17, 2020
1 parent d6ed4e0 commit ef6a79e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gizeh/gizeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def draw(ctx):
ctx.set_font_size(fontsize)
xbear, ybear, w, h, xadvance, yadvance = ctx.text_extents(txt)
xshift = {"left": 0, "center": -w / 2, "right": -w}[h_align] - xbear
yshift = {"bottom": 0, "center": -h / 2, "top": -h}[v_align] - ybear
yshift = {"top": 0, "center": -h / 2, "bottom": -h}[v_align] - ybear
new_xy = np.array(xy) + np.array([xshift, yshift])
ctx.move_to(*new_xy)
ctx.text_path(txt)
Expand Down

0 comments on commit ef6a79e

Please sign in to comment.