Removed widget alignment for the draw functions of toggleables

This commit is contained in:
Jacob Ahnstedt 2023-11-26 10:44:37 +01:00
parent c5ee9a58ed
commit 2a52826392
3 changed files with 12 additions and 12 deletions

View File

@ -6078,8 +6078,8 @@ enum nk_toggle_type {
NK_TOGGLE_OPTION NK_TOGGLE_OPTION
}; };
NK_LIB nk_bool nk_toggle_behavior(const struct nk_input *in, struct nk_rect select, nk_flags *state, nk_bool active); NK_LIB nk_bool nk_toggle_behavior(const struct nk_input *in, struct nk_rect select, nk_flags *state, nk_bool active);
NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment); NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags text_alignment);
NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment); NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags text_alignment);
NK_LIB nk_bool nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, nk_bool *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment); NK_LIB nk_bool nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, nk_bool *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment);
/* progress */ /* progress */
@ -24722,7 +24722,7 @@ nk_draw_checkbox(struct nk_command_buffer *out,
nk_flags state, const struct nk_style_toggle *style, nk_bool active, nk_flags state, const struct nk_style_toggle *style, nk_bool active,
const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *label, const struct nk_rect *selector,
const struct nk_rect *cursors, const char *string, int len, const struct nk_rect *cursors, const char *string, int len,
const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment) const struct nk_user_font *font, nk_flags text_alignment)
{ {
const struct nk_style_item *background; const struct nk_style_item *background;
const struct nk_style_item *cursor; const struct nk_style_item *cursor;
@ -24765,7 +24765,7 @@ nk_draw_option(struct nk_command_buffer *out,
nk_flags state, const struct nk_style_toggle *style, nk_bool active, nk_flags state, const struct nk_style_toggle *style, nk_bool active,
const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *label, const struct nk_rect *selector,
const struct nk_rect *cursors, const char *string, int len, const struct nk_rect *cursors, const char *string, int len,
const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment) const struct nk_user_font *font, nk_flags text_alignment)
{ {
const struct nk_style_item *background; const struct nk_style_item *background;
const struct nk_style_item *cursor; const struct nk_style_item *cursor;
@ -24871,9 +24871,9 @@ nk_do_toggle(nk_flags *state,
if (style->draw_begin) if (style->draw_begin)
style->draw_begin(out, style->userdata); style->draw_begin(out, style->userdata);
if (type == NK_TOGGLE_CHECK) { if (type == NK_TOGGLE_CHECK) {
nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font, widget_alignment, text_alignment); nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font, text_alignment);
} else { } else {
nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font, widget_alignment, text_alignment); nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font, text_alignment);
} }
if (style->draw_end) if (style->draw_end)
style->draw_end(out, style->userdata); style->draw_end(out, style->userdata);

View File

@ -255,8 +255,8 @@ enum nk_toggle_type {
NK_TOGGLE_OPTION NK_TOGGLE_OPTION
}; };
NK_LIB nk_bool nk_toggle_behavior(const struct nk_input *in, struct nk_rect select, nk_flags *state, nk_bool active); NK_LIB nk_bool nk_toggle_behavior(const struct nk_input *in, struct nk_rect select, nk_flags *state, nk_bool active);
NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment); NK_LIB void nk_draw_checkbox(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags text_alignment);
NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment); NK_LIB void nk_draw_option(struct nk_command_buffer *out, nk_flags state, const struct nk_style_toggle *style, nk_bool active, const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *cursors, const char *string, int len, const struct nk_user_font *font, nk_flags text_alignment);
NK_LIB nk_bool nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, nk_bool *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment); NK_LIB nk_bool nk_do_toggle(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r, nk_bool *active, const char *str, int len, enum nk_toggle_type type, const struct nk_style_toggle *style, const struct nk_input *in, const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment);
/* progress */ /* progress */

View File

@ -26,7 +26,7 @@ nk_draw_checkbox(struct nk_command_buffer *out,
nk_flags state, const struct nk_style_toggle *style, nk_bool active, nk_flags state, const struct nk_style_toggle *style, nk_bool active,
const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *label, const struct nk_rect *selector,
const struct nk_rect *cursors, const char *string, int len, const struct nk_rect *cursors, const char *string, int len,
const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment) const struct nk_user_font *font, nk_flags text_alignment)
{ {
const struct nk_style_item *background; const struct nk_style_item *background;
const struct nk_style_item *cursor; const struct nk_style_item *cursor;
@ -69,7 +69,7 @@ nk_draw_option(struct nk_command_buffer *out,
nk_flags state, const struct nk_style_toggle *style, nk_bool active, nk_flags state, const struct nk_style_toggle *style, nk_bool active,
const struct nk_rect *label, const struct nk_rect *selector, const struct nk_rect *label, const struct nk_rect *selector,
const struct nk_rect *cursors, const char *string, int len, const struct nk_rect *cursors, const char *string, int len,
const struct nk_user_font *font, nk_flags widget_alignment, nk_flags text_alignment) const struct nk_user_font *font, nk_flags text_alignment)
{ {
const struct nk_style_item *background; const struct nk_style_item *background;
const struct nk_style_item *cursor; const struct nk_style_item *cursor;
@ -175,9 +175,9 @@ nk_do_toggle(nk_flags *state,
if (style->draw_begin) if (style->draw_begin)
style->draw_begin(out, style->userdata); style->draw_begin(out, style->userdata);
if (type == NK_TOGGLE_CHECK) { if (type == NK_TOGGLE_CHECK) {
nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font, widget_alignment, text_alignment); nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font, text_alignment);
} else { } else {
nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font, widget_alignment, text_alignment); nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font, text_alignment);
} }
if (style->draw_end) if (style->draw_end)
style->draw_end(out, style->userdata); style->draw_end(out, style->userdata);