diff options
author | Pablo Vazquez <pablo@blender.org> | 2021-10-15 12:54:07 +0300 |
---|---|---|
committer | Pablo Vazquez <pablo@blender.org> | 2021-10-15 12:54:07 +0300 |
commit | e46055ae9dbd77271878b35cdd061cb7cc7e1afc (patch) | |
tree | 94db25bbb106559a977d35e0d0861ac25c92ea07 | |
parent | 93a8fd1249ffc64ee089b8c3192908dec247fc07 (diff) |
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!
-rw-r--r-- | source/blender/editors/interface/view2d_draw.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |