From 8d53ead69bb536acb6ce582440df2dec0b53343a Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Fri, 27 May 2022 11:24:03 +0200 Subject: 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 --- source/blender/editors/interface/view2d.cc | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'source/blender/editors/interface') 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; -- cgit v1.2.3