From ef6a79e465cb8ff65a61fb3c0ae543a637686226 Mon Sep 17 00:00:00 2001 From: Keven Cook Date: Sun, 17 May 2020 19:16:16 +0100 Subject: [PATCH] fixed issue with TextElement v_align top/bottom transposed --- gizeh/gizeh.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)