diff options
author | Leon Leno <lone_noel> | 2021-04-23 17:55:58 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-04-23 17:55:58 +0300 |
commit | c46367518827af5aebeb6377d0d04b59432b9107 (patch) | |
tree | 954fa3f5fe1a3afff26e02e85945cf9b9784a909 /source/blender/editors/interface/interface_widgets.c | |
parent | 9afa738542881cf69aa89fd893351200324c107f (diff) |
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
Diffstat (limited to 'source/blender/editors/interface/interface_widgets.c')
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; } |