Browse Source

fixed excess right space for UI_JUSTIFY|UI_WRAP

pull/1/head
Leonard Ritter 10 years ago
parent
commit
f366bbbdd9
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      example.cpp
  2. +1
    -1
      oui.h

+ 1
- 1
example.cpp View File

@@ -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);


+ 1
- 1
oui.h View File

@@ -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);


Loading…
Cancel
Save