Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -24434,13 +24434,12 @@ nk_draw_checkbox(struct nk_command_buffer *out,

/* draw background and cursor */
if (background->type == NK_STYLE_ITEM_COLOR) {
nk_fill_rect(out, *selector, 0, style->border_color);
nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, background->data.color);
nk_stroke_rect(out, *selector, 2, 2, background->data.color);
} else nk_draw_image(out, *selector, &background->data.image, nk_white);
if (active) {
if (cursor->type == NK_STYLE_ITEM_IMAGE)
nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
else nk_fill_rect(out, *cursors, 0, cursor->data.color);
else nk_fill_rect(out, *cursors, 0, background->data.color);
}

text.padding.x = 0;
Expand Down Expand Up @@ -24476,13 +24475,12 @@ nk_draw_option(struct nk_command_buffer *out,

/* draw background and cursor */
if (background->type == NK_STYLE_ITEM_COLOR) {
nk_fill_circle(out, *selector, style->border_color);
nk_fill_circle(out, nk_shrink_rect(*selector, style->border), background->data.color);
nk_stroke_circle(out, *selector, 2, background->data.color);
} else nk_draw_image(out, *selector, &background->data.image, nk_white);
if (active) {
if (cursor->type == NK_STYLE_ITEM_IMAGE)
nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
else nk_fill_circle(out, *cursors, cursor->data.color);
else nk_fill_circle(out, *cursors, background->data.color);
}

text.padding.x = 0;
Expand Down
1 change: 1 addition & 0 deletions src/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/// - [y]: Minor version with non-breaking API and library changes
/// - [z]: Patch version with no direct changes to the API
///
/// - 2022/10/03 (4.10.4) - Updated the look and feel of checkboxes and radio buttons to be more distinguishable
/// - 2022/09/03 (4.10.3) - Renamed the `null` texture variable to `tex_null`
/// - 2022/08/01 (4.10.2) - Fix Apple Silicon with incorrect NK_SITE_TYPE and NK_POINTER_TYPE
/// - 2022/08/01 (4.10.1) - Fix cursor jumping back to beginning of text when typing more than
Expand Down
10 changes: 4 additions & 6 deletions src/nuklear_toggle.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,12 @@ nk_draw_checkbox(struct nk_command_buffer *out,

/* draw background and cursor */
if (background->type == NK_STYLE_ITEM_COLOR) {
nk_fill_rect(out, *selector, 0, style->border_color);
nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, background->data.color);
nk_stroke_rect(out, *selector, 2, 2, background->data.color);
} else nk_draw_image(out, *selector, &background->data.image, nk_white);
if (active) {
if (cursor->type == NK_STYLE_ITEM_IMAGE)
nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
else nk_fill_rect(out, *cursors, 0, cursor->data.color);
else nk_fill_rect(out, *cursors, 0, background->data.color);
}

text.padding.x = 0;
Expand Down Expand Up @@ -91,13 +90,12 @@ nk_draw_option(struct nk_command_buffer *out,

/* draw background and cursor */
if (background->type == NK_STYLE_ITEM_COLOR) {
nk_fill_circle(out, *selector, style->border_color);
nk_fill_circle(out, nk_shrink_rect(*selector, style->border), background->data.color);
nk_stroke_circle(out, *selector, 2, background->data.color);
} else nk_draw_image(out, *selector, &background->data.image, nk_white);
if (active) {
if (cursor->type == NK_STYLE_ITEM_IMAGE)
nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
else nk_fill_circle(out, *cursors, cursor->data.color);
else nk_fill_circle(out, *cursors, background->data.color);
}

text.padding.x = 0;
Expand Down