New internal rounding handling, window rounding, nk_vec4, group_rounding style setting #450
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes how rounding is handled internally to allow per-corner rounding to be specified in the api. As the branch name may imply, this is in preperation for quite a chunky PR introducing a bunch new elements, which depend on this feature. I decided to split it here to keep changes a bit more organized.
nk_fill_rect and nk_stroke_rect may now take rounding per corner to create for instance just rounding at the top, a speech bubble like thingy by making it 0 in one corner or a whacky combination of different sizes.
![grafik](https://user-images.githubusercontent.com/60887273/164158003-9db0414d-7180-4a3a-af71-f306dc05db98.png)
Now rounding is specified by nk_vec4, which is essentially the same as the 4-float nk_rect, just with a different name. Since nk_rect specifies position and size, this didn't quite make sense for corner sizes, that's why the new vec4 type. The user-facing styling remains a single rounding float, so on that front nothing changes.
This unlocks window and group rounding to properly applied in regards to Titlebar and borders. Group rounding received it's own style property. Though some extra tweaks may be required to address how group borders are not the same thickness by default on all sides. Not every combination of Window features is clean though, the scroll bar may need to be patched to inherit one corner's window rounding, as the scrollbar pokes through in certain feature combinations like: No titlebar + scroll bar + no rounding on scrollbar.
#146 should be properly addressed with this.
Finally, I did try making a rounded scaler corner, but it was really just a dirt hack. This will be an extra PR later on.
![grafik](https://user-images.githubusercontent.com/60887273/164155543-3d9803eb-8b2d-436b-b8f2-4950cfa197bc.png)