Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-04-27 06:23:23 +0300
committerHans Goudey <h.goudey@me.com>2021-04-27 06:23:23 +0300
commitf682812f41f0957ac1f72cc105dfc06f250d7755 (patch)
tree6a6a222a56609aca48be2e148013f0bce41f607e /source
parentfe79935f0021755ba133020a3414f6c29b46e9aa (diff)
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
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
1 files changed, 1 insertions, 1 deletions
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) {