[Bf-blender-cvs] [4bf6ffc022f] master: Fix for T81757: Incorrect Overlay Line Height

Harley Acheson noreply at git.blender.org
Wed Oct 21 04:11:46 CEST 2020


Commit: 4bf6ffc022fdaea88f5289dfe085029df53bb95b
Author: Harley Acheson
Date:   Tue Oct 20 18:50:55 2020 -0700
Branches: master
https://developer.blender.org/rB4bf6ffc022fdaea88f5289dfe085029df53bb95b

Fix for T81757: Incorrect Overlay Line Height

Fixes error in determining 3DView Overlay Line Height. Do not base on current default font height.

Differential Revision: https://developer.blender.org/D9288

Reviewed by Campbell Barton

===================================================================

M	source/blender/blenfont/BLF_api.h
M	source/blender/blenfont/intern/blf.c
M	source/blender/editors/space_view3d/view3d_draw.c

===================================================================

diff --git a/source/blender/blenfont/BLF_api.h b/source/blender/blenfont/BLF_api.h
index 17a650e28f5..bf84f5c57b3 100644
--- a/source/blender/blenfont/BLF_api.h
+++ b/source/blender/blenfont/BLF_api.h
@@ -163,13 +163,8 @@ float BLF_height_ex(int fontid, const char *str, size_t len, struct ResultBLF *r
 float BLF_height(int fontid, const char *str, size_t len) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 
 /* Return dimensions of the font without any sample text. */
-
 int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT;
-int BLF_default_height_max(void) ATTR_WARN_UNUSED_RESULT;
-
 float BLF_width_max(int fontid) ATTR_WARN_UNUSED_RESULT;
-float BLF_default_width_max(void) ATTR_WARN_UNUSED_RESULT;
-
 float BLF_descender(int fontid) ATTR_WARN_UNUSED_RESULT;
 float BLF_ascender(int fontid) ATTR_WARN_UNUSED_RESULT;
 
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index 76ff498f5c2..c8940add738 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -824,11 +824,6 @@ int BLF_height_max(int fontid)
   return 0;
 }
 
-int BLF_default_height_max(void)
-{
-  return BLF_height_max(global_font_default);
-}
-
 float BLF_width_max(int fontid)
 {
   FontBLF *font = blf_get(fontid);
@@ -840,11 +835,6 @@ float BLF_width_max(int fontid)
   return 0.0f;
 }
 
-float BLF_default_width_max(void)
-{
-  return BLF_width_max(global_font_default);
-}
-
 float BLF_descender(int fontid)
 {
   FontBLF *font = blf_get(fontid);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index af03cddfbf5..633344837a1 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -102,7 +102,7 @@
 
 #define M_GOLDEN_RATIO_CONJUGATE 0.618033988749895f
 
-#define VIEW3D_OVERLAY_LINEHEIGHT (int)(1.1f * BLF_default_height_max())
+#define VIEW3D_OVERLAY_LINEHEIGHT (0.9f * U.widget_unit)
 
 /* -------------------------------------------------------------------- */
 /** \name General Functions



More information about the Bf-blender-cvs mailing list