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
commit7a5e81cf7f0e123ad44e68c032bc48f60b1bf529 (patch)
tree0b9411e3ad3487d96bf10badf8ab01c3d0df0f29
parent47fafcf916df444282103df634bac9b6d8502737 (diff)
parentb383b29b1c021cc7cc930c6ca4fbf888a8ebee2c (diff)
downloadnuk.lv2-7a5e81cf7f0e123ad44e68c032bc48f60b1bf529.zip
nuk.lv2-7a5e81cf7f0e123ad44e68c032bc48f60b1bf529.tar.gz
nuk.lv2-7a5e81cf7f0e123ad44e68c032bc48f60b1bf529.tar.bz2
nuk.lv2-7a5e81cf7f0e123ad44e68c032bc48f60b1bf529.tar.xz
Merge commit 'b383b29b1c021cc7cc930c6ca4fbf888a8ebee2c'
-rw-r--r--nuklear/nuklear.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/nuklear/nuklear.h b/nuklear/nuklear.h
index 9d7183b..3ae9a13 100644
--- a/nuklear/nuklear.h
+++ b/nuklear/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;