Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Strange Border with StrokeThickness and Clipped Content #7521

Closed
Phenek opened this issue May 27, 2022 · 9 comments · Fixed by #10964
Closed

[Bug] Strange Border with StrokeThickness and Clipped Content #7521

Phenek opened this issue May 27, 2022 · 9 comments · Fixed by #10964
Assignees
Labels
fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor platform/android 🤖 platform/iOS 🍎 s/needs-attention Issue has more information and needs another look s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@Phenek
Copy link

Phenek commented May 27, 2022

Description

Hello,

Borders StrokeThickness does not have the same width between iOS and Android.

Android seems to not have a perfect interior line rounded
iOS seems ok, but it put an extract padding on the left image

PS: Right Image has a negative padding to see the clip issue, but it's a known issue #7576 #6986
--------------------------Android------------------------------------------------------------ iOS-------------------------
Screenshot 2022-05-27 at 17 26 03

Steps to Reproduce

  1. Create a new Border
  2. Put as a Content a Grid with some stuff in it (Images ,etc..)
  3. Use a RoundRectangle as Border.StrokeShape with different CornerRadius to see the result.

--------------------------iOS------------------------------------------- Android-------------------------
Screenshot 2022-05-27 at 13 08 20

                <Border StrokeThickness="20"
                        Stroke="Silver"
                        Background="White"
                        Margin="0"
                        Padding="0">
                    <Border.StrokeShape>
                        <RoundRectangle CornerRadius="30" />
                    </Border.StrokeShape>
                    <Grid HeightRequest="30" BackgroundColor="Green">
                        <StackLayout Orientation="Horizontal">
                            <Frame Padding="0" HasShadow="false"
                                   BackgroundColor="Maroon"
                                   CornerRadius="20"
                                   HeightRequest="40"
                                   WidthRequest="40" VerticalOptions="Center" >
                            </Frame>
                            <Label Text="Parameters"
                                   VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
                                   FontSize="Medium" FontFamily="Bold"
                                   HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
                            <Frame Padding="0" HasShadow="false" CornerRadius="0" Margin="0,0,-20,0"
                                   BackgroundColor="Blue"
                                   HeightRequest="40"
                                   WidthRequest="40" VerticalOptions="Center" >
                            </Frame>
                        </StackLayout>
                    </Grid>
                </Border>

Expected Behavior

Screenshot 2022-05-27 at 17 22 38

Version with bug

6.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android

Affected platform versions

MAUI 6.0.312

Did you find any workaround?

No response

Relevant log output

No response

@Phenek Phenek added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels May 27, 2022
@kristinx0211
Copy link

@Phenek thanks for your report, could you provide a sample project/screenshots or more details that we can reproduce your issue? That should greatly speed up the process, thanks!

@kristinx0211 kristinx0211 added the s/needs-repro Attach a solution or code which reproduces the issue label May 27, 2022
@ghost
Copy link

ghost commented May 27, 2022

Hi @Phenek. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Phenek
Copy link
Author

Phenek commented May 27, 2022

Hello,

I updated the issue I provide you the Xaml sample.
No need an entire project, just copy and past

                <Border StrokeThickness="20"
                        Stroke="Silver"
                        Background="White"
                        Margin="0"
                        Padding="0">
                    <Border.StrokeShape>
                        <RoundRectangle CornerRadius="30" />
                    </Border.StrokeShape>
                    <Grid HeightRequest="30" BackgroundColor="Green">
                        <StackLayout Orientation="Horizontal">
                            <Frame Padding="0" HasShadow="false"
                                   BackgroundColor="Maroon"
                                   CornerRadius="20"
                                   HeightRequest="40"
                                   WidthRequest="40" VerticalOptions="Center" >
                            </Frame>
                            <Label Text="Parameters"
                                   VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
                                   FontSize="Medium" FontFamily="Bold"
                                   HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
                            <Frame Padding="0" HasShadow="false" CornerRadius="0" Margin="0,0,-20,0"
                                   BackgroundColor="Blue"
                                   HeightRequest="40"
                                   WidthRequest="40" VerticalOptions="Center" >
                            </Frame>
                        </StackLayout>
                    </Grid>
                </Border>

-------------------------iOS------------------------------------------------------Android--------------------
Screenshot 2022-05-27 at 13 08 20

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-repro Attach a solution or code which reproduces the issue labels May 27, 2022
@Phenek Phenek changed the title [Bug] Strange Border with StrokeThickness [Bug] Strange Border with StrokeThickness and Clipped Content May 27, 2022
@jsuarezruiz jsuarezruiz self-assigned this May 27, 2022
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 27, 2022
@kristinx0211 kristinx0211 added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels May 31, 2022
@kristinx0211
Copy link

can be reproduced on android with above code.

@jsuarezruiz
Copy link
Contributor

Tried with the latest version and the result on Android is the following:

Screenshot_1656586810

Is the expected one right?. On iOS the current version is not clipping the content, have been fixed by #7335 and will be available in the upcoming version.

@jsuarezruiz jsuarezruiz added s/needs-info Issue needs more info from the author and removed s/needs-attention Issue has more information and needs another look labels Jun 30, 2022
@jsuarezruiz jsuarezruiz added this to the 6.0-sr3 milestone Jun 30, 2022
@ghost
Copy link

ghost commented Jun 30, 2022

Hi @Phenek. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@Phenek Phenek closed this as completed Jun 30, 2022
@Phenek Phenek reopened this Jun 30, 2022
@Phenek
Copy link
Author

Phenek commented Jun 30, 2022

@jsuarezruiz Glad to see that coming!

I see you choose an inside border that overlap the content.
I think it's the best compromise, it let us the choise to make a padding on the content of the size of the border or as we wish.

But we still have a little issue, I just removed the green background and found this on Android,
I don't know if it's the clip or the border that has the wrong StrokeThickness, but they should follow each other
---------------------------------Android-----------------------------------
Screenshot 2022-06-30 at 23 16 23
We are not so far from the perfect behavior!

I am unable to test iOS, because Maui App crash at startup, I will try next time.

                <Border StrokeThickness="10"
                        Stroke="Silver"
                        Background="White"
                        Margin="0"
                        Padding="0"
                        HeightRequest="60">
                    <Border.StrokeShape>
                        <RoundRectangle CornerRadius="30" />
                    </Border.StrokeShape>
                    <Grid HeightRequest="30">
                        <StackLayout Orientation="Horizontal" HeightRequest="30">
                            <Frame Padding="0" HasShadow="false"
                                   BackgroundColor="Maroon"
                                   CornerRadius="20"
                                   HeightRequest="40"
                                   WidthRequest="40" VerticalOptions="Center" >
                            </Frame>
                            <Label Text="Parameters"
                                   VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"
                                   FontSize="Medium" FontFamily="Bold"
                                   HorizontalTextAlignment="Center" VerticalTextAlignment="Center" />
                            <Frame Padding="0" HasShadow="false" CornerRadius="0"
                                   BackgroundColor="Blue"
                                   HeightRequest="40"
                                   WidthRequest="40" VerticalOptions="Center" >
                            </Frame>
                        </StackLayout>
                    </Grid>
                </Border>

@ghost ghost added s/needs-attention Issue has more information and needs another look and removed s/needs-info Issue needs more info from the author labels Jun 30, 2022
@Phenek
Copy link
Author

Phenek commented Jul 9, 2022

@jsuarezruiz So here a little update on the issue,
this is inside a StackLayout with 0 spacing.
---------------------------iOS--------------------------|-----------------------Android---------------------
Screenshot 2022-07-09 at 11 20 10

@samhouts samhouts added p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint and removed p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint labels Jul 18, 2022
@mattleibow mattleibow modified the milestones: 6.0-sr3, 6.0-servicing Aug 29, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@samhouts samhouts added the fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! label Apr 12, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 12, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 8 May 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-8.0.0-preview.3.8149 Look for this fix in 8.0.0-preview.3.8149! legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor platform/android 🤖 platform/iOS 🍎 s/needs-attention Issue has more information and needs another look s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants