[Bf-blender-cvs] [5c2330203e1] master: Fix T92293: Clipped labels for graph editor modifiers

Campbell Barton noreply at git.blender.org
Mon Oct 25 13:29:09 CEST 2021


Commit: 5c2330203e11e0d916960218b07d88d2193bf526
Author: Campbell Barton
Date:   Mon Oct 25 22:27:51 2021 +1100
Branches: master
https://developer.blender.org/rB5c2330203e11e0d916960218b07d88d2193bf526

Fix T92293: Clipped labels for graph editor modifiers

While c7d94a7827a5be9343eea22a9638bb059f185206 exposed this bug,
this was caused by a discrepancy in padding where labels would
have additional padding when drawing without emboss.
The padding made widget drawing behave as if the text took up more
room causing it to be clipped.

Now labels are considered the same width with/without emboss.

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

M	source/blender/editors/interface/interface_widgets.c

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

diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index e9acc65ed37..61d66c44a39 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -4632,6 +4632,9 @@ void ui_draw_but(const bContext *C, struct ARegion *region, uiStyle *style, uiBu
     switch (but->type) {
       case UI_BTYPE_LABEL:
         wt = widget_type(UI_WTYPE_ICON_LABEL);
+        if (!(but->flag & UI_HAS_ICON)) {
+          but->drawflag |= UI_BUT_NO_TEXT_PADDING;
+        }
         break;
       default:
         wt = widget_type(UI_WTYPE_ICON);



More information about the Bf-blender-cvs mailing list