Nuklear
Nuklear copied to clipboard
Add a way to specify a stroke type, Center/Inner/Outter
info: this PR message will be updated since the PR has changed
When window's padding is set to 0, you can see that widget's borders get clipped
I'm still not sure if that is the right solution, but it works for me
In case this is not an accepted PR, it'll provide a solution for those affected by this problem
Before:
After:
Looking great! Still clipped on the left when anti-aliasing is off. I find the - 0.5f on there questionable too, but that may be the center stroke strategy you mentioned. Perhaps we need to roundf() it?
https://github.com/Immediate-Mode-UI/Nuklear/blob/master/src/nuklear_vertex.c#L965
if (list->line_AA == NK_ANTI_ALIASING_ON) {
nk_draw_list_path_rect_to(list, nk_vec2(rect.x, rect.y),
nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
} else {
nk_draw_list_path_rect_to(list, nk_vec2(rect.x-0.5f, rect.y-0.5f),
nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
} nk_draw_list_path_fill(list, col);