You're right, there's a clearly a problem there. I wonder why I was subtracting 1 to the radius and size (width or height). I think the subtraction on the size that you kept should not even be there, I tested and it works correctly.
Now there's still another problem. I'm testing with a 512x512 image with an UbuntuShape of the same size with fillMode set to PreserveAspectCrop, if you set the width (or height) to an even value, the rendering is good, if you set it to an odd value the rendering is slightly stretched.
You're right, there's a clearly a problem there. I wonder why I was subtracting 1 to the radius and size (width or height). I think the subtraction on the size that you kept should not even be there, I tested and it works correctly.
Now there's still another problem. I'm testing with a 512x512 image with an UbuntuShape of the same size with fillMode set to PreserveAspectCrop, if you set the width (or height) to an even value, the rendering is good, if you set it to an odd value the rendering is slightly stretched.