Skip to content

Commit

Permalink
Fixed missing color factoring for widget disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Ahnstedt committed Nov 20, 2023
1 parent 304856e commit afbd133
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -22673,15 +22673,16 @@ nk_tree_element_image_push_hashed_base(struct nk_context *ctx, enum nk_tree_type

switch (background->type) {
case NK_STYLE_ITEM_IMAGE:
nk_draw_image(out, header, &background->data.image, nk_white);
nk_draw_image(out, header, &background->data.image, nk_rgb_factor(nk_white, style->tab.color_factor));
break;
case NK_STYLE_ITEM_NINE_SLICE:
nk_draw_nine_slice(out, header, &background->data.slice, nk_white);
nk_draw_nine_slice(out, header, &background->data.slice, nk_rgb_factor(nk_white, style->tab.color_factor));
break;
case NK_STYLE_ITEM_COLOR:
nk_fill_rect(out, header, 0, style->tab.border_color);
nk_fill_rect(out, header, 0, nk_rgb_factor(style->tab.border_color, style->tab.color_factor));
nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
style->tab.rounding, background->data.color);
style->tab.rounding, nk_rgb_factor(background->data.color, style->tab.color_factor));

break;
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/nuklear_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,16 @@ nk_tree_element_image_push_hashed_base(struct nk_context *ctx, enum nk_tree_type

switch (background->type) {
case NK_STYLE_ITEM_IMAGE:
nk_draw_image(out, header, &background->data.image, nk_white);
nk_draw_image(out, header, &background->data.image, nk_rgb_factor(nk_white, style->tab.color_factor));
break;
case NK_STYLE_ITEM_NINE_SLICE:
nk_draw_nine_slice(out, header, &background->data.slice, nk_white);
nk_draw_nine_slice(out, header, &background->data.slice, nk_rgb_factor(nk_white, style->tab.color_factor));
break;
case NK_STYLE_ITEM_COLOR:
nk_fill_rect(out, header, 0, style->tab.border_color);
nk_fill_rect(out, header, 0, nk_rgb_factor(style->tab.border_color, style->tab.color_factor));
nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
style->tab.rounding, background->data.color);
style->tab.rounding, nk_rgb_factor(background->data.color, style->tab.color_factor));

break;
}
}
Expand Down

0 comments on commit afbd133

Please sign in to comment.