[Bf-blender-cvs] [8d53ead69bb] master: Fix T97500: NLA strip names drawn outside strip

Colin Basnett noreply at git.blender.org
Fri May 27 11:28:25 CEST 2022


Commit: 8d53ead69bb536acb6ce582440df2dec0b53343a
Author: Colin Basnett
Date:   Fri May 27 11:24:03 2022 +0200
Branches: master
https://developer.blender.org/rB8d53ead69bb536acb6ce582440df2dec0b53343a

Fix T97500: NLA strip names drawn outside strip

Fix T97500 by removing the logic that for some unknown reason draws the
entire string if the min/max were swapped.

This function is only called in two places, once here in the NLA, and
the VSE. The bug only materializes in the NLA though.

Reviewed By: sybren

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

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

M	source/blender/editors/interface/view2d.cc

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

diff --git a/source/blender/editors/interface/view2d.cc b/source/blender/editors/interface/view2d.cc
index 66171dc13e4..6ece7eb4ffa 100644
--- a/source/blender/editors/interface/view2d.cc
+++ b/source/blender/editors/interface/view2d.cc
@@ -2103,21 +2103,12 @@ void UI_view2d_text_cache_draw(ARegion *region)
       col_pack_prev = v2s->col.pack;
     }
 
-    if (v2s->rect.xmin >= v2s->rect.xmax) {
-      BLF_draw_default((float)(v2s->mval[0] + xofs),
-                       (float)(v2s->mval[1] + yofs),
-                       0.0,
-                       v2s->str,
-                       BLF_DRAW_STR_DUMMY_MAX);
-    }
-    else {
-      BLF_enable(font_id, BLF_CLIPPING);
-      BLF_clipping(
-          font_id, v2s->rect.xmin - 4, v2s->rect.ymin - 4, v2s->rect.xmax + 4, v2s->rect.ymax + 4);
-      BLF_draw_default(
-          v2s->rect.xmin + xofs, v2s->rect.ymin + yofs, 0.0f, v2s->str, BLF_DRAW_STR_DUMMY_MAX);
-      BLF_disable(font_id, BLF_CLIPPING);
-    }
+    BLF_enable(font_id, BLF_CLIPPING);
+    BLF_clipping(
+        font_id, v2s->rect.xmin - 4, v2s->rect.ymin - 4, v2s->rect.xmax + 4, v2s->rect.ymax + 4);
+    BLF_draw_default(
+        v2s->rect.xmin + xofs, v2s->rect.ymin + yofs, 0.0f, v2s->str, BLF_DRAW_STR_DUMMY_MAX);
+    BLF_disable(font_id, BLF_CLIPPING);
   }
   g_v2d_strings = nullptr;



More information about the Bf-blender-cvs mailing list