Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Shapes] Should the default value of Shape.StrokeThickness be 1, and not 0? #11497

Closed
opcodewriter opened this issue Jul 21, 2020 · 0 comments
Closed

Comments

@opcodewriter
Copy link

opcodewriter commented Jul 21, 2020

Description

The Shape.StrokeThickness property has default value of 1.0

        public static readonly BindableProperty StrokeThicknessProperty =
            BindableProperty.Create(nameof(StrokeThickness), typeof(double), typeof(Shape), 1.0);

https://github.com/xamarin/Xamarin.Forms/blob/main/Xamarin.Forms.Core/Shapes/Shape.cs#L16

This means all shapes have a stroke thickness and you have to set either a global style to remove it or set property to zero on every shape!

Wouldn't be better if it's the other way around? Not all shapes always need a stroke. Having StrokeThickness 0 as default would be consistent with BorderWidth (for controls which have it) which has 0 as default. Why should BorderWidth be zero and StrokeThickness 1?

In UWP and WinUI, the default StrokeThickness is 0.
https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.shapes.shape.strokethickness?view=winrt-19041

In WPF, it's 1, but I think they realized it and hence it changed in UWP and WinUI

@opcodewriter opcodewriter added s/unverified New report that has yet to be verified t/bug 🐛 labels Jul 21, 2020
@samhouts samhouts added this to New in Triage Jul 22, 2020
@hartez hartez removed the s/unverified New report that has yet to be verified label Jul 24, 2020
@hartez hartez added this to Under consideration in Enhancements via automation Jul 24, 2020
@hartez hartez removed this from New in Triage Jul 24, 2020
Enhancements automation moved this from Under consideration to Closed Jul 30, 2020
@samhouts samhouts added this to In Progress in vCurrent (4.8.0) Jul 30, 2020
@samhouts samhouts moved this from In Progress to Done in vCurrent (4.8.0) Jul 30, 2020
@samhouts samhouts removed this from Closed in Enhancements Aug 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

No branches or pull requests

4 participants