diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-03-13 18:26:34 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-03-13 18:26:34 +0300 |
commit | 17e0565cc5748f959ec318c472b28ff9e41ed507 (patch) | |
tree | 5aebf4da79e578c9eed0db43a1d4bc90b5452520 | |
parent | 3952fd199ac9285049bb22e3f9bb9aac822030c5 (diff) |
Fix T58668: Misaligned text when editing multiple values
Reviewers: brecht
Differential Revision: https://developer.blender.org/D4503
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 04a329b2607..e8657b617b9 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -2143,11 +2143,21 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle, const uiWidgetColor rect->xmin += icon_size + icon_padding; } - if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) { - rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect; + int text_padding = (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect; + if (but->editstr) { + rect->xmin += text_padding; + } + else if (but->flag & UI_BUT_DRAG_MULTI) { + bool text_is_edited = ui_but_drag_multi_edit_get(but) != NULL; + if (text_is_edited) { + rect->xmin += text_padding; + } } - else if ((but->drawflag & UI_BUT_TEXT_RIGHT)) { - rect->xmax -= (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect; + else if (but->drawflag & UI_BUT_TEXT_LEFT) { + rect->xmin += text_padding; + } + else if (but->drawflag & UI_BUT_TEXT_RIGHT) { + rect->xmax -= text_padding; } /* Menu contains sub-menu items with triangle icon on their right. Shortcut |