This commit is contained in:
vurtun 2017-06-21 12:19:49 +02:00
commit ecd16919bb

View File

@ -13674,6 +13674,7 @@ nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size)
NK_ASSERT(state);
NK_ASSERT(memory);
if (!state || !memory || !size) return;
NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
nk_str_init_fixed(&state->string, memory, size);
}
@ -13684,6 +13685,7 @@ nk_textedit_init(struct nk_text_edit *state, struct nk_allocator *alloc, nk_size
NK_ASSERT(state);
NK_ASSERT(alloc);
if (!state || !alloc) return;
NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
nk_str_init(&state->string, alloc, size);
}
@ -13694,6 +13696,7 @@ nk_textedit_init_default(struct nk_text_edit *state)
{
NK_ASSERT(state);
if (!state) return;
NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
nk_str_init_default(&state->string);
}
@ -21694,10 +21697,12 @@ nk_plot(struct nk_context *ctx, enum nk_chart_type type, const float *values,
min_value = NK_MIN(values[i + offset], min_value);
max_value = NK_MAX(values[i + offset], max_value);
}
nk_chart_begin(ctx, type, count, min_value, max_value);
for (i = 0; i < count; ++i)
nk_chart_push(ctx, values[i + offset]);
nk_chart_end(ctx);
if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
for (i = 0; i < count; ++i)
nk_chart_push(ctx, values[i + offset]);
nk_chart_end(ctx);
}
}
NK_API void
@ -21718,10 +21723,12 @@ nk_plot_function(struct nk_context *ctx, enum nk_chart_type type, void *userdata
min_value = NK_MIN(value, min_value);
max_value = NK_MAX(value, max_value);
}
nk_chart_begin(ctx, type, count, min_value, max_value);
for (i = 0; i < count; ++i)
nk_chart_push(ctx, value_getter(userdata, i + offset));
nk_chart_end(ctx);
if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
for (i = 0; i < count; ++i)
nk_chart_push(ctx, value_getter(userdata, i + offset));
nk_chart_end(ctx);
}
}
/* -------------------------------------------------------------