Fix for UI layout alignment of fixed-size items (including those with width < min. width). Such layout items were ignoring the center and right alignment in layouts before.

This commit is contained in:
Lukas Toenne
2012-05-11 17:05:10 +00:00
parent c8da0d01d4
commit fe33fc8db3

View File

@@ -1776,12 +1776,12 @@ static void ui_litem_layout_row(uiLayout *litem)
/* align right/center */
offset = 0;
if (litem->alignment == UI_LAYOUT_ALIGN_RIGHT) {
if (freew > 0 && freew < w - fixedw)
offset = (w - fixedw) - freew;
if (freew + fixedw > 0 && freew + fixedw < w)
offset = w - (fixedw + freew);
}
else if (litem->alignment == UI_LAYOUT_ALIGN_CENTER) {
if (freew > 0 && freew < w - fixedw)
offset = ((w - fixedw) - freew) / 2;
if (freew + fixedw > 0 && freew + fixedw < w)
offset = (w - (fixedw + freew)) / 2;
}
/* position item */