summaryrefslogtreecommitdiff
path: root/new/stack.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-14 12:47:58 -0400
committerPietro Gagliardi <[email protected]>2015-04-14 12:47:58 -0400
commite9920c70c034d430f19475c230f3e85a056f4358 (patch)
treeb1e7bbe8095b2d7fc918052fd312d26dcac9e834 /new/stack.c
parent21f122161e551b286af4537a59f20d46b824e383 (diff)
Fixed moving label on Windows.
Diffstat (limited to 'new/stack.c')
-rw-r--r--new/stack.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/new/stack.c b/new/stack.c
index 7c1c792..f2c3129 100644
--- a/new/stack.c
+++ b/new/stack.c
@@ -3,7 +3,6 @@
// TODO
// - rename to uiBox
-// - on windows, removing a control from one stack and adding it to another doesn't actually move the control (just removing it works though, so...)
typedef struct stack stack;
typedef struct stackControl stackControl;
@@ -355,11 +354,11 @@ void uiStackAdd(uiControl *st, uiControl *c, int stretchy)
}
s->controls[s->len].c = c;
s->controls[s->len].stretchy = stretchy;
+ s->len++; // must be here for parent updates to work
if (s->parent != NULL) {
- uiControlSetParent(s->controls[s->len].c, s->parent);
+ uiControlSetParent(s->controls[s->len - 1].c, s->parent);
uiParentUpdate(s->parent);
}
- s->len++;
}
void uiStackRemove(uiControl *st, uintmax_t index)