Border element corner radius does not match when adding thickness.
Hey all, discovered this while playing around with the main menu tutorial. I was looking for a way to have the image box grid on the banner clip to the rounded rectangle shape so that all the components didn't have to have matching Corner Radius values. I discovered that if Border Thickness is added then the corner radius will not match up anymore, even though the values are the same.
in the screenshot the green Border element is Corner Radius = 24 with no Border Thickness, the red Border element is Corner Radius = 24 with Border Thickness = 4
Is this expected?
Thanks
Is this expected?
Thanks
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Border element corner radius does not match when adding thickness.
Yes, it is the expected behavior (the same that can be seen in WPF) as the specified radius determines the radius of the stroke geometry, which is positioned at the center of the stroke thickness:
You can calculate the radius of the stroked Border, to get the same outer radius of the non-stroked Border by doing:
We're thinking on adding a helper in the property editor to automatically calculate this in case you want to specify the outer corner radius. Would that be helpful?
You can calculate the radius of the stroked Border, to get the same outer radius of the non-stroked Border by doing:
Code: Select all
strokedCornerRadius = desiredCornerRadius - borderThickness * 0.5Re: Border element corner radius does not match when adding thickness.
Thanks for the explainer!
Yeah I think a helper for setting the outer corner radius would be really helpful.
Yeah I think a helper for setting the outer corner radius would be really helpful.
Who is online
Users browsing this forum: No registered users and 3 guests