Fix for error exposed by right-align number buttons

When the entire label was clipped, the right aligned number component
could be clipped on its left hand side too.
So "Foo: 1.00" could be clipped to ".00"
This commit is contained in:
Campbell Barton 2013-12-13 02:47:00 +11:00
parent 2195dd32cc
commit 9ad88fbe6d
1 changed files with 6 additions and 2 deletions

View File

@ -1311,14 +1311,18 @@ static void widget_draw_text_icon(uiFontStyle *fstyle, uiWidgetColors *wcol, uiB
rect->xmin += (int)(0.8f * BLI_rcti_size_y(rect));
if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT)) {
rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
if (but->editstr || but->ofs == 0) {
rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
}
}
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 += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
if (but->ofs == 0) {
rect->xmin += (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;
}
}
else if ((but->drawflag & UI_BUT_TEXT_RIGHT)) {
rect->xmax -= (UI_TEXT_MARGIN_X * U.widget_unit) / but->block->aspect;