aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-01-05 17:54:20 +0100
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2018-01-05 17:54:20 +0100
commitb383b29b1c021cc7cc930c6ca4fbf888a8ebee2c (patch)
tree83cda01c0e74968a7c7ea6830b86d0221589c474
parent658b7d575d49481fa79629477a6893fed358c5fe (diff)
downloadnuk.lv2-b383b29b1c021cc7cc930c6ca4fbf888a8ebee2c.zip
nuk.lv2-b383b29b1c021cc7cc930c6ca4fbf888a8ebee2c.tar.gz
nuk.lv2-b383b29b1c021cc7cc930c6ca4fbf888a8ebee2c.tar.bz2
nuk.lv2-b383b29b1c021cc7cc930c6ca4fbf888a8ebee2c.tar.xz
Squashed 'nuklear/' changes from e8761c7..ecf3995
ecf3995 Fix invalid y_offset bug in nk_group_begin. git-subtree-dir: nuklear git-subtree-split: ecf399564aa05d6e37c57afae699365a57428902
-rw-r--r--nuklear.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/nuklear.h b/nuklear.h
index 9d7183b..3ae9a13 100644
--- a/nuklear.h
+++ b/nuklear.h
@@ -22230,15 +22230,19 @@ nk_group_begin(struct nk_context *ctx, const char *title, nk_flags flags)
title_len = (int)nk_strlen(title);
title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_GROUP);
x_offset = nk_find_value(win, title_hash);
+ y_offset = nk_find_value(win, title_hash+1);
if (!x_offset) {
x_offset = nk_add_value(ctx, win, title_hash, 0);
- y_offset = nk_add_value(ctx, win, title_hash+1, 0);
-
NK_ASSERT(x_offset);
+ if (!x_offset) return 0;
+ *x_offset = 0;
+ }
+ if (!y_offset) {
+ y_offset = nk_add_value(ctx, win, title_hash+1, 0);
NK_ASSERT(y_offset);
- if (!x_offset || !y_offset) return 0;
- *x_offset = *y_offset = 0;
- } else y_offset = nk_find_value(win, title_hash+1);
+ if (!y_offset) return 0;
+ *y_offset = 0;
+ }
return nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags);
}
@@ -22275,15 +22279,19 @@ nk_list_view_begin(struct nk_context *ctx, struct nk_list_view *view,
title_len = (int)nk_strlen(title);
title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_GROUP);
x_offset = nk_find_value(win, title_hash);
+ y_offset = nk_find_value(win, title_hash+1);
if (!x_offset) {
x_offset = nk_add_value(ctx, win, title_hash, 0);
- y_offset = nk_add_value(ctx, win, title_hash+1, 0);
-
NK_ASSERT(x_offset);
+ if (!x_offset) return 0;
+ *x_offset = 0;
+ }
+ if (!y_offset) {
+ y_offset = nk_add_value(ctx, win, title_hash+1, 0);
NK_ASSERT(y_offset);
- if (!x_offset || !y_offset) return 0;
- *x_offset = *y_offset = 0;
- } else y_offset = nk_find_value(win, title_hash+1);
+ if (!y_offset) return 0;
+ *y_offset = 0;
+ }
view->scroll_value = *y_offset;
view->scroll_pointer = y_offset;