From e46055ae9dbd77271878b35cdd061cb7cc7e1afc Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Fri, 15 Oct 2021 11:54:07 +0200 Subject: [PATCH] UI: Fix offset of vertical scale indicators `BLF_height_max()` uses the tallest character in the font, and many characters in our font are taller than numbers. Use `BLF_height` with `0` as reference instead. Fix by @harley, thanks! --- source/blender/editors/interface/view2d_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/editors/interface/view2d_draw.c b/source/blender/editors/interface/view2d_draw.c index a4b37e571d7..b1869fbf2f9 100644 --- a/source/blender/editors/interface/view2d_draw.c +++ b/source/blender/editors/interface/view2d_draw.c @@ -405,7 +405,7 @@ static void draw_vertical_scale_indicators(const ARegion *region, const float xpos = (rect->xmin + x_offset) * UI_DPI_FAC; const float ymin = rect->ymin; const float ymax = rect->ymax; - const float y_offset = (BLF_height_max(font_id) / 2.0f) - U.pixelsize; + const float y_offset = (BLF_height(font_id, "0", 1) / 2.0f) - U.pixelsize; for (uint i = 0; i < steps; i++) { const float ypos_view = start + i * distance;