fixed zr_spacing
This commit is contained in:
parent
3e6d7bb1ec
commit
a59a5f54d6
10
demo/demo.c
10
demo/demo.c
@ -61,7 +61,6 @@ show_test_window(struct zr_window *window, struct zr_style *config, enum theme *
|
||||
|
||||
/* collapsable headers */
|
||||
static int window_option_state = ZR_MINIMIZED;
|
||||
static int header_option_state = ZR_MINIMIZED;
|
||||
static int widget_state = ZR_MINIMIZED;
|
||||
static int graph_state = ZR_MINIMIZED;
|
||||
static int style_state = ZR_MINIMIZED;
|
||||
@ -283,17 +282,8 @@ show_test_window(struct zr_window *window, struct zr_style *config, enum theme *
|
||||
zr_checkbox(&layout, "Resizable", &resize);
|
||||
zr_checkbox(&layout, "Moveable", &moveable);
|
||||
zr_checkbox(&layout, "No Scrollbar", &no_scrollbar);
|
||||
zr_layout_pop(&layout);
|
||||
}
|
||||
|
||||
if (zr_layout_push(&layout, ZR_LAYOUT_TAB, "Header", &header_option_state))
|
||||
{
|
||||
/* header options */
|
||||
zr_layout_row_dynamic(&layout, 30, 2);
|
||||
zr_checkbox(&layout, "Minimizable", &minimizable);
|
||||
zr_checkbox(&layout, "Closeable", &close);
|
||||
zr_checkbox(&layout, "Scaleable", &scale);
|
||||
zr_checkbox(&layout, "Moveable", &move);
|
||||
zr_layout_pop(&layout);
|
||||
}
|
||||
|
||||
|
10
zahnrad.c
10
zahnrad.c
@ -6879,8 +6879,7 @@ zr_layout_pop(struct zr_context *layout)
|
||||
void
|
||||
zr_spacing(struct zr_context *l, zr_size cols)
|
||||
{
|
||||
zr_size i, n;
|
||||
zr_size index;
|
||||
zr_size i, index, rows;
|
||||
struct zr_rect nil;
|
||||
|
||||
ZR_ASSERT(l);
|
||||
@ -6891,16 +6890,17 @@ zr_spacing(struct zr_context *l, zr_size cols)
|
||||
|
||||
/* spacing over row boundries */
|
||||
index = (l->row.index + cols) % l->row.columns;
|
||||
if (l->row.index + cols > l->row.columns) {
|
||||
zr_size rows = (l->row.index + cols) / l->row.columns;
|
||||
rows = (l->row.index + cols) / l->row.columns;
|
||||
if (rows) {
|
||||
for (i = 0; i < rows; ++i)
|
||||
zr_panel_alloc_row(l);
|
||||
cols = index;
|
||||
}
|
||||
|
||||
/* non table layout need to allocate space */
|
||||
if (l->row.type != ZR_LAYOUT_DYNAMIC_FIXED &&
|
||||
l->row.type != ZR_LAYOUT_STATIC_FIXED) {
|
||||
for (i = 0; i < index; ++i)
|
||||
for (i = 0; i < cols; ++i)
|
||||
zr_panel_alloc_space(&nil, l);
|
||||
}
|
||||
l->row.index = index;
|
||||
|
Loading…
x
Reference in New Issue
Block a user