2#include "nuklear_internal.h"
11 const char *title, nk_flags flags,
int row_height,
int row_count)
27 if (!ctx || !view || !title)
return 0;
31 item_spacing = style->window.spacing;
32 row_height += NK_MAX(0, (
int)item_spacing.y);
35 title_len = (int)nk_strlen(title);
36 title_hash = nk_murmur_hash(title, (
int)title_len, NK_PANEL_GROUP);
37 x_offset = nk_find_value(win, title_hash);
39 x_offset = nk_add_value(ctx, win, title_hash, 0);
40 y_offset = nk_add_value(ctx, win, title_hash+1, 0);
44 if (!x_offset || !y_offset)
return 0;
45 *x_offset = *y_offset = 0;
46 }
else if (!(y_offset = nk_find_value(win, title_hash+1))) {
48 if (!y_offset)
return 0;
49 *x_offset = *y_offset = 0;
51 view->scroll_value = *y_offset;
52 view->scroll_pointer = y_offset;
59 view->total_height = row_height * NK_MAX(row_count,1);
60 view->begin = (int)NK_MAX(((
float)view->scroll_value / (
float)row_height), 0.0f);
61 view->count = (int)NK_MAX(nk_iceilf((layout->clip.h)/(float)row_height),0);
62 view->count = NK_MIN(view->count, row_count - view->begin);
63 view->end = view->begin + view->count;
76 NK_ASSERT(view->scroll_pointer);
77 if (!view || !view->ctx)
return;
82 layout->at_y = layout->bounds.y + (float)view->total_height;
83 *view->scroll_pointer = *view->scroll_pointer + view->scroll_value;
main API and documentation file
NK_API nk_bool nk_group_scrolled_offset_begin(struct nk_context *, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
NK_API void nk_group_end(struct nk_context *)