Repository navigation
Conversation
|
Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines. |
| Handler?.UpdateValue(nameof(IBorderStroke.StrokeDashPattern)); | ||
| } | ||
|
|
||
| void UpdateStrokeShape() |
There was a problem hiding this comment.
When using a Shape in the StrokeShape property, we didn't have the StrokeTickness mapped from the Border to the Shape.
| { | ||
| if (StrokeShape is Shape strokeShape) | ||
| { | ||
| strokeShape.StrokeThickness = StrokeThickness; |
There was a problem hiding this comment.
StrokeShape "only" needs the information to define the Shape to use for the border and to clip the content. It uses IShape so Shapes and Geometries can be used. This, apart from cause confusion, has problems:
- Shape: In addition to specifying the geometry of the shape, it has properties to define the stroke, thickness, etc. None of these properties are used, although the thickness does impact the size of the Shape. It inherits the size of the parent so it's easy to use but have unused properties under this scenario.
- Geometry: Designed for clipping, it only has the information to define the Path to use. It does not have properties that have no effect as in the case of Shape, but instead, you must specify the size and properties that define each type of Geometry.
To improve this situation, we should apply changes to use Geometry or, if we want to make it easier to use and avoid requiring setting sizes, etc., create a new type like IStrokeShape that defines only the Shape without having properties to manage colors, stroke, etc. In In case of choose this second option, I would also ask, does it make sense to allow using a Line for example? I think having Rectangle, RoundRectangle, Ellipse and Path covers all scenarios.
There was a problem hiding this comment.
is this the only property we need to update ?
There was a problem hiding this comment.
Yes, is the only one impacting in the size. The rest are not used because we don't apply colors or any other effect; just use the defined path to draw the Border.
Description of Change
Fix Border 1px margin issue in all the platforms.
Applying zoom:

To validate the changes, launch the .NET MAUI Gallery and navigate to the Border samples. Use the included sample in this PR yo check the border margins.
Issues Fixed
Fixes #7764