GUI.Rectangle cannot achieve semicircular fillet

As shown in the following figure:

A semicircular shape cannot be achieved with cornerRadius
What I want to achieve:

PR up: Rectangles couldn’t get correctly rounded because -2 was subtracted f… by carolhmj · Pull Request #12863 · BabylonJS/Babylon.js (


I took a look and used the test environment for testing, but the effect did not meet my expectations,
The semicircle is not reached

Yes, I agree that it is not reached. Something around the x-value, may be?
If I scale the container on X, I am that close to reaching it.

If you split the rectangles both are rounded:

But when they are overlaid on top of each other some pixels from the bottom bleed through and give the impression of a less rounded shape.

Hmm :face_with_monocle:. No (sry), I’m afraid this example does not match a semicircle shape. Just draw a circle on top of it and you will see that it isn’t.

I reviewed the maths for drawing rectangles, now we can get a circle! Draw rectangles with properly rounded corners by carolhmj · Pull Request #12876 · BabylonJS/Babylon.js ( Thanks for double checking the fix ya’ll :smiley:

1 Like