From f366bbbdd91538d44b9d0994e6773a5174731341 Mon Sep 17 00:00:00 2001 From: Leonard Ritter Date: Tue, 23 Sep 2014 15:50:30 +0200 Subject: [PATCH] fixed excess right space for UI_JUSTIFY|UI_WRAP --- example.cpp | 2 +- oui.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/example.cpp b/example.cpp index fa424b4..9aae1c6 100644 --- a/example.cpp +++ b/example.cpp @@ -805,7 +805,7 @@ void build_rowdemo(int parent) { demorect(box, "Layout( UI_DOWN )", 0.25f, 0, UI_DOWN, T, T, 0, 0, M, M); } { - int box = demorect(parent, "Box( UI_ROW )\nLayout( UI_FILL )", 0.6f, UI_ROW, UI_FILL, 0, S, M, 0, M, M); + int box = demorect(parent, "Box( UI_ROW | UI_JUSTIFY )\nLayout( UI_FILL )", 0.6f, UI_ROW|UI_JUSTIFY, UI_FILL, 0, S, M, 0, M, M); demorect(box, "Layout( UI_TOP )", 0.05f, 0, UI_TOP, T, T, M, M, M, 0); demorect(box, "Layout( UI_VCENTER )", 0.1f, 0, UI_VCENTER, T, T, 0, 0, M, 0); diff --git a/oui.h b/oui.h index 6af0f80..57fa446 100644 --- a/oui.h +++ b/oui.h @@ -1164,7 +1164,6 @@ UI_INLINE void uiArrangeStacked(UIitem *pitem, int dim, bool wrap) { while (kid >= 0) { UIitem *pkid = uiItemPtr(kid); int flags = (pkid->flags & UI_ITEM_LAYOUT_MASK) >> dim; - total++; short extend = used; if ((flags & UI_HFILL) == UI_HFILL) { // grow count++; @@ -1181,6 +1180,7 @@ UI_INLINE void uiArrangeStacked(UIitem *pitem, int dim, bool wrap) { used = extend; kid = uiNextSibling(kid); } + total++; } int extra_space = ui_max(space - used,0);