From f682812f41f0957ac1f72cc105dfc06f250d7755 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 26 Apr 2021 22:23:23 -0500 Subject: Fix T87749: Fix text jitter in buttons with icons This patch fixes the remaining issues described in T87749. The jitter was caused by inconsistent rounding when using the floats icon_size and icon_padding to offset the bound for the text drawing. Using `round_fl_to_int` leads to consistent results and fixes the jitter that remained in some buttons with icons, UI lists, and breadcrumbs. Differential Revision: https://developer.blender.org/D11062 --- source/blender/editors/interface/interface_widgets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 8dbebe2a94c..c9c1f56dc98 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2416,7 +2416,7 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle, but->block->aspect = aspect_orig; #endif - rect->xmin += icon_size + icon_padding; + rect->xmin += round_fl_to_int(icon_size + icon_padding); } if (!no_text_padding) { -- cgit v1.2.3