0
votes

Either I'm going crazy or borders with a corner radius do not render correctly in UWP. Take this extremely simple example:

<Border CornerRadius="6" BorderBrush="Blue" BorderThickness="1">
     <Rectangle Fill="Black"   />
</Border>

And see how the rectangle extends slightly beyond border:

enter image description here

This happens in the designer in the visual studio and when the app is running.

It only seems to happen when there is a borderthickness >0 on the border.

Any idea why this happens?

1

1 Answers

0
votes

If you are looking to apply corner radius to rectangle. Its better to use RadiusX and RadiusY properties of rectangle. Using like this will not cause any issues in rendering.

<Rectangle Width="100" RadiusX="10" RadiusY="10" Height="60" Stroke="Red" StrokeThickness="2" Fill="Black" > </Rectangle>

enter image description here