Nuklear icon indicating copy to clipboard operation
Nuklear copied to clipboard

Add a way to specify a stroke type, Center/Inner/Outter

Open ryuukk opened this issue 1 year ago • 4 comments

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:

image

After:

image

ryuukk avatar Sep 25 '24 14:09 ryuukk

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);

RobLoach avatar Sep 25 '24 15:09 RobLoach