From 71482224d59d51733b4d27ab0430f93f0ca69ea7 Mon Sep 17 00:00:00 2001 From: Leonard Ritter Date: Mon, 14 Jul 2014 21:05:51 +0200 Subject: [PATCH] oui: small layout improvement when mixing fixed and dynamic child items --- oui.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/oui.h b/oui.h index 4e9029d..a4ae403 100644 --- a/oui.h +++ b/oui.h @@ -956,10 +956,10 @@ static void uiLayoutChildItem(UIitem *pparent, UIitem *pitem, int *dyncount, int } break; case UI_HFILL: { if (pitem->size.v[dim]) { // hard maximum size; can't stretch - if (hasl) - pitem->rect.v[dim] = x+s-pitem->rect.v[wdim]-pitem->margins[wdim]; - else + if (!hasl) pitem->rect.v[dim] = x+pitem->margins[dim]; + else + pitem->rect.v[dim] = x+s-pitem->rect.v[wdim]-pitem->margins[wdim]; } else { if (1) { //!pitem->rect.v[wdim]) { int width = (pparent->rect.v[wdim] - pparent->computed_size.v[dim]);