Open jonathanpeppers opened 1 year ago
/cc @jsuarezruiz maybe something needs to change in this sample to work w/ main?
We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.
/cc @jsuarezruiz maybe something needs to change in this sample to work w/ main?
The only recent change affecting Border is this https://github.com/dotnet/maui/pull/10964, but it hasn't been merged yet. I've been checking and:
ShapeDrawable
class, the Draw method is invoked and it is drawn.But, the Path was not visible, it was being drawn but it was not visible. Why?. After reviewing the visual tree in detail I realized that the Path is drawn out of position and since Border clips the outline, it is not visible.
Removing the vertical and horizontal alignment options:
I have to review the changes related with Layout from stable to main. Maybe @hartez could help us here.
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 3.0(net8). Can repro on Android platform with sample project. /netmaui-surfing-app-challenge
I wonder if this is the same issue as https://github.com/dotnet/maui/issues/17111
I was able to reproduce this using net8.0 (built from main) on android.
The clipping around the avatar images also seems wrong.
Oddly, the Microsoft.Maui.Samples app that does the same thing does not have these issues.
This may be a bug in Path??
Using this as my Maui.Controls.Samples.Sandbox MainPage.xaml
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.MainPage"
xmlns:local="clr-namespace:Maui.Controls.Sample">
<Grid ColumnDefinitions="Auto, Auto" RowDefinitions="Auto" VerticalOptions="Center" HorizontalOptions="Center" Background="Pink">
<Border Grid.Row="0" Grid.Column="0" Background="LightBlue" StrokeThickness="0" HeightRequest="44" WidthRequest="44">
<Border.StrokeShape>
<Ellipse />
</Border.StrokeShape>
<Border.Shadow>
<Shadow Opacity="0.5" Offset="4, 4"/>
</Border.Shadow>
<Path Fill="Black" HorizontalOptions="Center" VerticalOptions="Center" Scale="0.5" Margin="6"
Data="M0,0L15.825011,8.0009766 31.650999,15.997986 15.825011,23.998993 0,32 0,15.997986z"/>
</Border>
<Path Grid.Row="0" Grid.Column="1" Fill="Black" HorizontalOptions="Center" VerticalOptions="Center" Scale="0.5" Margin="6"
Data="M0,0L15.825011,8.0009766 31.650999,15.997986 15.825011,23.998993 0,32 0,15.997986z"/>
</Grid>
</ContentPage>
It renders like this:
If I specify a WidthRequest and HeightRequest, things work:
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.MainPage"
xmlns:local="clr-namespace:Maui.Controls.Sample">
<Grid ColumnDefinitions="Auto, Auto" RowDefinitions="Auto" VerticalOptions="Center" HorizontalOptions="Center" Background="Pink">
<Border Grid.Row="0" Grid.Column="0" Background="LightBlue" StrokeThickness="0" HeightRequest="44" WidthRequest="44">
<Border.StrokeShape>
<Ellipse />
</Border.StrokeShape>
<Border.Shadow>
<Shadow Opacity="0.5" Offset="4, 4"/>
</Border.Shadow>
<Path Fill="Black" HorizontalOptions="Center" VerticalOptions="Center" Scale="0.5" Margin="6" WidthRequest="31.651" HeightRequest="32"
Data="M0,0L15.825011,8.0009766 31.650999,15.997986 15.825011,23.998993 0,32 0,15.997986z"/>
</Border>
<Path Grid.Row="0" Grid.Column="1" Background="LightGreen" Fill="Black" HorizontalOptions="Center" VerticalOptions="Center" WidthRequest="31.651" HeightRequest="32" Scale="0.5" Margin="6"
Data="M0,0L15.825011,8.0009766 31.650999,15.997986 15.825011,23.998993 0,32 0,15.997986z"/>
</Grid>
</ContentPage>
They also work if I remove the Margin="6"
from the Path
element.
The above PR improves things by at least calculating the correct size for the Path
s.
Unfortunately, things still don't render in the surfer app (but do in the test case above) unless I unset the Margin
.
This goes back to what @jsuarezruiz was saying regarding the path being drawn out of position somehow.
Okay, so I think that the Scale must be getting applied after Margins and Vertical/HorizontalOptions are applied, which is causing the Path to be effectively rendered outside the clip path for the containing ContentViewGroup.
I have no idea how to proceed.
Description
I'm working on: https://github.com/dotnet/maui/issues/9485
The "Play Button" disappeared, it is something like:
Steps to Reproduce
Run this app w/ dotnet/maui/main: https://github.com/jsuarezruiz/netmaui-surfing-app-challenge
Link to public reproduction project repository
https://github.com/jsuarezruiz/netmaui-surfing-app-challenge
Version with bug
8.0 previews
Last version that worked well
7.0 (current)
Affected platforms
Android
Affected platform versions
API 33
Did you find any workaround?
No
Relevant log output