Open elcritch opened 10 months ago
The problem comes if you don't want to draw pixel aligned rect. Boxy is not just for UI stuff. If your mat is pixel aligned this should not be an issue? Maybe a better fix, if you know you are doing UI, is to make sure that boxy.mat is aligned to pixels or half pixels? Thoughts?
The problem comes if you don't want to draw pixel aligned rect. Boxy is not just for UI stuff.
Ah, that makes sense. Hmmm, that's tricky.
If your mat is pixel aligned this should not be an issue? Maybe a better fix, if you know you are doing UI, is to make sure that boxy.mat is aligned to pixels or half pixels? Thoughts?
That might work. When I tried previously I could only try to ensure the at
and to
were truncated or rounded. I'm not sure how one would align the boxy.mat.
The issue always seemed to come down to ensuring that two rect boundaries wouldn't overlap or leave a gap. The ceil(boxy.mat * vec2(at.x, to.y))
was the only way I figured how to get that to work with rounding errors and all.
Perhaps a compile time flag could work if nothing else?
I'm also not sure how to port the Fidget clipping model to the Boxy layering method.
I ported some GUI code to Boxy and see some artifacts when aligning rectangles and images next to each other. In particular it's quite noticeable with 9-patch boxes.
It looks to be similar to Fidget, which I previously tracked down to floating point rounding after doing the uv position transformations in proc drawUvRect.
I ported the fix I did in Fidget and it appears to resolve the issue in Boxy as well: