question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Strange Border with StrokeThickness and Clipped Content

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Phenekcommented, 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>
0reactions
msftbot[bot]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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UWP border rendering issue - xaml
Literally any content causes the same issue. The border does not clip its contents properly is the issue. – Martin Richards. Feb 27,...
Read more >
[Bug] Stroke thickness doesn't change
Whenever I set rectangle's strokes per side to «all», the bug instantly disappears. And whenever I set individual border again, the bug appears ......
Read more >
WPF Expander Border Animation affects all contained controls?
Opacity makes everything disappear. You have two choices: 1. Animate the border Stroke property, or 2. Change the content to not be a...
Read more >
Writing a XAML application with geometry objects (shapes) ...
Border to enable geometry object (shape) clipping. (The System.Windows.Controls. ... First the XAML file with omitted canvas content.
Read more >
Coherent PDF Command Line Tools User Manual
The possible boxes are. /MediaBox, /CropBox, /BleedBox, /TrimBox, /ArtBox. A hard box (one which clips its contents by inserting a clipping rectangle) may...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found