maui icon indicating copy to clipboard operation
maui copied to clipboard

[regression/8.0.0-preview.4.8333] Line is not visible in .Net 8

Open shanmugasundar-sf3429 opened this issue 1 year ago • 6 comments

Description

Have tried to add line using "Microsoft.Maui.Controls.Shapes.Line" in .Net 6 and checked the same scenario in .Net 8. But the line was not visible in .Net 8.

Sample DotNetEightUnderline.zip

Screenshot

.Net 6 : image

.Net 8 : image

Steps to Reproduce

  1. Run the attached sample.
  2. Now you can see the output.

Link to public reproduction project repository

https://github.com/shanmugasundar-sf3429/TextMarkupAnnotationVisibility

Version with bug

8.0.0-preview.4.8333

Is this a regression from previous behavior?

Yes

Last version that worked well

8.0.0-preview.3.8149

Affected platforms

iOS, Android, Windows, macOS, I was not able test on other platforms

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

shanmugasundar-sf3429 avatar Sep 11 '23 11:09 shanmugasundar-sf3429

I just noticed this with Rectangle on Windows; BackgroundColor doesn't seem to have an effect anymore, but if you set Fill then it works.

Edit: this is on latest public .NET 8 Preview. Edit 2: previously worked on latest .NET 7 for us 👍

TiberiusDRAIG avatar Sep 12 '23 04:09 TiberiusDRAIG

Verified this on Visual Studio Enterprise 17.8.0 Preview 1.0. Repro on Windows 11(8.0.0-preview.7.8842), Android 13.0-API33 and iOS 16.4 with below Project: DotNetEightUnderline.zip

XamlTest avatar Sep 12 '23 06:09 XamlTest

Confirmed that this regressed between 8.0.0-preview.4.8333 and 8.0.0-preview.3.8149. https://github.com/dotnet/maui/pull/14216 seems sus.

samhouts avatar Sep 13 '23 23:09 samhouts

@jsuarezruiz

samhouts avatar Sep 13 '23 23:09 samhouts

The issue is still there. with 8.0.6

pierre01 avatar Jan 20 '24 09:01 pierre01

Would you please fix this in upcoming release soon? We have Line used at plenty of places in a very big project and we don't want to invest time to replace it with something else at those many places as a ugly workaround. This is time consuming for us.

Hope you would consider this for priority fix.

Thanks.

MGohil avatar Jan 25 '24 08:01 MGohil

I don't know if it is a bug but I found this workaround

<Style TargetType="Line">
    <Setter Property="Stroke" Value="DarkGray"/>
    <Setter Property="X2" Value="{Binding Width, Source={RelativeSource Self}}"  />
</Style>

When I set the Fill, BackgroundColour, HeightRequest, and WidthRequest, the line finally appears. <Line HeightRequest="1" Fill="Red" WidthRequest="1000" BackgroundColor="Red"/>

DanCodes1414 avatar Feb 13 '24 10:02 DanCodes1414

Ok, few comments/questions here:

  1. Why is MAUI framework checking BackgroundColor and Fill, with AND operand?
  2. What exactly is overriding width/height with zeroes fixing? Lines aside, not specifying width/height is making other shapes (Rectangle for example) to not render. Making HorizontalOptions useless.
  3. Am I expected to go through all views, every time I update my MAUI version, just to check if my Lines (or something more important) suddenly has stopped rendering correctly. Or at all.

Those are not compile time exceptions. You do not get runtime exceptions either. One would think that after few years, the situation should get better, not worse. Those shapes were working in .NET 7.

H-A-Hristov avatar Apr 04 '24 14:04 H-A-Hristov