[Bf-blender-cvs] [c4636751882] blender-v2.93-release: Fix T87749 (partially): Text jitter in buttons and spreadsheet editor
Leon Leno
noreply at git.blender.org
Fri Apr 23 16:56:15 CEST 2021
Commit: c46367518827af5aebeb6377d0d04b59432b9107
Author: Leon Leno
Date: Fri Apr 23 09:55:58 2021 -0500
Branches: blender-v2.93-release
https://developer.blender.org/rBc46367518827af5aebeb6377d0d04b59432b9107
Fix T87749 (partially): Text jitter in buttons and spreadsheet editor
This patch fixes jittering text when resizing regions of the UI as
described in T87749. The jitter was caused by the text padding
being stored as an integer which lead to inconsistent rounding.
Most notably this patch fixes the jitter in the new spreadsheet editor,
but not all occurrences of jitter described in T87749 (e.g. in UI lists)
are addressed.
Differential Revision: https://developer.blender.org/D11060
===================================================================
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 e351cd30c14..8dbebe2a94c 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2420,7 +2420,8 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle,
}
if (!no_text_padding) {
- const int text_padding = (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
+ const int text_padding = round_fl_to_int((UI_TEXT_MARGIN_X * U.widget_unit) /
+ but->block->aspect);
if (but->editstr) {
rect->xmin += text_padding;
}
More information about the Bf-blender-cvs
mailing list