[Bf-blender-cvs] [c8cef83faec] blender-v3.2-release: Fix T96157: Make size of Frame Node label independent from Line Width

Dominik Fill noreply at git.blender.org
Mon May 30 19:23:29 CEST 2022


Commit: c8cef83faece3eeda6d2020e8335931045cdaa73
Author: Dominik Fill
Date:   Mon May 30 19:19:07 2022 +0200
Branches: blender-v3.2-release
https://developer.blender.org/rBc8cef83faece3eeda6d2020e8335931045cdaa73

Fix T96157: Make size of Frame Node label independent from Line Width

This commits corrects the calculation of the Frame Node label size,
making it independent of the 'Line Width' user preference.

Since `U.dpi` is actually DPI divided by `U.pixelsize` and `U.pixelsize`
is calculated from line-width multiplying by `U.pixelsize` undoes
the connection between line-width and label size.
It now stays the same, regardless of the line-width setting.

Reviewed By: Julian Eisel, Harley Acheson

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

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

M	source/blender/editors/space_node/node_draw.cc

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

diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 9076b17a926..738d482bea3 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -2654,7 +2654,7 @@ static void frame_node_draw_label(const bNodeTree &ntree,
   BLF_enable(fontid, BLF_ASPECT);
   BLF_aspect(fontid, aspect, aspect, 1.0f);
   /* clamp otherwise it can suck up a LOT of memory */
-  BLF_size(fontid, MIN2(24.0f, font_size), U.dpi);
+  BLF_size(fontid, MIN2(24.0f, font_size) * U.pixelsize, U.dpi);
 
   /* title color */
   int color_id = node_get_colorid(node);



More information about the Bf-blender-cvs mailing list