diff --git a/gizeh/gizeh.py b/gizeh/gizeh.py index 4974bd0..f591ca5 100644 --- a/gizeh/gizeh.py +++ b/gizeh/gizeh.py @@ -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)