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

Clipping an Image with a Border has a gap on Windows #9129

Closed
tchtang opened this issue Aug 2, 2022 · 6 comments · Fixed by #14403
Closed

Clipping an Image with a Border has a gap on Windows #9129

tchtang opened this issue Aug 2, 2022 · 6 comments · Fixed by #14403
Assignees
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@tchtang
Copy link

tchtang commented Aug 2, 2022

Description

XAML is

    <Grid BackgroundColor="Blue">
        <Grid.RowDefinitions>
            <!-- label, search -->
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <HorizontalStackLayout Grid.Row="0" Margin="20">
            <!-- meal all -->
            <Border Stroke="LightGray" StrokeThickness="3">
                <Border.StrokeShape>
                    <RoundRectangle CornerRadius="20" />
                </Border.StrokeShape>
                <VerticalStackLayout BackgroundColor="#f0f0f0">
                    <Image Aspect="AspectFill" HeightRequest="100" Source="meal_all.jpg" WidthRequest="100" />
                    <Label HorizontalTextAlignment="Center" Margin="0,5" Text="All" />
                </VerticalStackLayout>
            </Border>
            <!-- meal noodle -->
            <Border Stroke="LightGray" StrokeThickness="3">
                <Border.StrokeShape>
                    <RoundRectangle CornerRadius="20" />
                </Border.StrokeShape>
                <Grid BackgroundColor="#f0f0f0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <Image Grid.Row="0" Aspect="AspectFill" HeightRequest="100" Source="meal_noodle.jpg" WidthRequest="100" />
                    <Label Grid.Row="1" HorizontalTextAlignment="Center" Margin="0,5" Text="Noodle" />
                </Grid>
            </Border>
            <!-- meal rice -->
            <Border Stroke="LightGray" StrokeThickness="3">
                <Border.StrokeShape>
                    <RoundRectangle CornerRadius="20" />
                </Border.StrokeShape>
                <VerticalStackLayout BackgroundColor="#f0f0f0">
                    <Image Aspect="AspectFill" HeightRequest="100" Source="meal_rice.jpg" WidthRequest="100" />
                    <Label HorizontalTextAlignment="Center" Margin="0,5" Text="Rice" />
                </VerticalStackLayout>
            </Border>
        </HorizontalStackLayout>
    </Grid>

Android API 30 is okay

image

Window 10 has gap

image

Public API Changes

.

Intended Use-Case

please reduce gap within Border

@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Aug 2, 2022
@jfversluis jfversluis added t/bug Something isn't working platform/windows 🪟 area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing and removed proposal/open area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter labels Aug 2, 2022
@jfversluis jfversluis changed the title reduce gap within Border Clipping an Image with a Border has a gap on Windows Aug 2, 2022
@jfversluis jfversluis added this to the Backlog milestone Aug 2, 2022
@jsuarezruiz jsuarezruiz self-assigned this Aug 16, 2022
@breenbob
Copy link
Contributor

breenbob commented Jan 13, 2023

This is affecting me as well. I've used Border with RadioButton and VisualStateManager to create a custom segmented control, but I'm seeing different behaviour with Border on every platform:

Windows (dark mode but clearly same issue as above):
image

Android (Spot on):
image

iOS (slightly different issue, acts as if padding set but all controls have Padding/Margin/Spacing=0, and only TL and TR corners are clipped):
image

@breenbob
Copy link
Contributor

breenbob commented Jan 13, 2023

Based on my screenshots I think possibly title should be modified to include iOS and platform/iOS label added.

@jsuarezruiz
Copy link
Contributor

@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels May 25, 2023
@XamlTest
Copy link

Verified this on Visual Studio Enterprise 17.7.0 Preview 1.0. Repro on Windows 11 and iOS 16.4 with below Project:

Windows 11: Repro
image

Android 13.0: Not repro.
image

iOS: Repro
image

@mikeparker104 mikeparker104 added the partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with label Jun 19, 2023
@samhouts samhouts added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Jun 21, 2023
@breenbob
Copy link
Contributor

@jsuarezruiz Is this issue also fixed with your PR #10964?

@jsuarezruiz
Copy link
Contributor

@jsuarezruiz Is this issue also fixed with your PR #10964?

No, that one applied changes mostly for iOS. Will be fixed by #14403

@github-project-automation github-project-automation bot moved this from In Progress to Done in MAUI SDK Ongoing Jul 28, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/windows 🪟 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
8 participants