forked from bartvdbraak/blender
Bug fix #34868
Pulldown menus with long shortcut text labels got clipped badly occasionally. Made the offset follow DPI better.
This commit is contained in:
parent
8a06acfd7a
commit
093f95afaa
@ -162,7 +162,7 @@ void uiStyleFontDrawExt(uiFontStyle *fs, const rcti *rect, const char *str,
|
||||
}
|
||||
}
|
||||
else if (fs->align == UI_STYLE_TEXT_RIGHT) {
|
||||
xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str) - 1;
|
||||
xofs = BLI_rcti_size_x(rect) - BLF_width(fs->uifont_id, str) - 0.1f * U.widget_unit;
|
||||
}
|
||||
|
||||
/* clip is very strict, so we give it some space */
|
||||
|
@ -1265,7 +1265,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b
|
||||
/* part text right aligned */
|
||||
if (cpoin) {
|
||||
fstyle->align = UI_STYLE_TEXT_RIGHT;
|
||||
rect->xmax -= ui_but_draw_menu_icon(but) ? UI_DPI_ICON_SIZE : 5;
|
||||
rect->xmax -= ui_but_draw_menu_icon(but) ? UI_DPI_ICON_SIZE : 0.25f * U.widget_unit;
|
||||
uiStyleFontDraw(fstyle, rect, cpoin + 1);
|
||||
*cpoin = '|';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user