UI: don't attempt to draw with the menu-key when only drawing right aligned
This commit is contained in:
@@ -1122,9 +1122,6 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
|
|||||||
char *drawstr_right = NULL;
|
char *drawstr_right = NULL;
|
||||||
bool use_right_only = false;
|
bool use_right_only = false;
|
||||||
|
|
||||||
/* for underline drawing */
|
|
||||||
float font_xofs, font_yofs;
|
|
||||||
|
|
||||||
uiStyleFontSet(fstyle);
|
uiStyleFontSet(fstyle);
|
||||||
|
|
||||||
if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT))
|
if (but->editstr || (but->drawflag & UI_BUT_TEXT_LEFT))
|
||||||
@@ -1217,9 +1214,11 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
|
|||||||
glColor4ubv((unsigned char *)wcol->text);
|
glColor4ubv((unsigned char *)wcol->text);
|
||||||
|
|
||||||
if (!use_right_only) {
|
if (!use_right_only) {
|
||||||
|
/* for underline drawing */
|
||||||
|
float font_xofs, font_yofs;
|
||||||
|
|
||||||
uiStyleFontDrawExt(fstyle, rect, but->drawstr + but->ofs,
|
uiStyleFontDrawExt(fstyle, rect, but->drawstr + but->ofs,
|
||||||
drawstr_left_len - but->ofs, &font_xofs, &font_yofs);
|
drawstr_left_len - but->ofs, &font_xofs, &font_yofs);
|
||||||
}
|
|
||||||
|
|
||||||
if (but->menu_key != '\0') {
|
if (but->menu_key != '\0') {
|
||||||
char fixedbuf[128];
|
char fixedbuf[128];
|
||||||
@@ -1252,6 +1251,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* part text right aligned */
|
/* part text right aligned */
|
||||||
if (drawstr_right) {
|
if (drawstr_right) {
|
||||||
|
|||||||
Reference in New Issue
Block a user