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 y_offset = nk_find_value(win, title_hash+1);
47 view->scroll_value = *y_offset;
48 view->scroll_pointer = y_offset;
55 view->total_height = row_height * NK_MAX(row_count,1);
56 view->begin = (int)NK_MAX(((
float)view->scroll_value / (
float)row_height), 0.0f);
57 view->count = (int)NK_MAX(nk_iceilf((layout->clip.h)/(float)row_height),0);
58 view->count = NK_MIN(view->count, row_count - view->begin);
59 view->end = view->begin + view->count;
72 NK_ASSERT(view->scroll_pointer);
73 if (!view || !view->ctx)
return;
78 layout->at_y = layout->bounds.y + (float)view->total_height;
79 *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 *)