dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.12k stars 1.73k forks source link

[regression/8.0.0-rc.2.9530] Incorrect Rendering of Gradient Color on iOS and macOS when Clipping Custom View #18671

Open surya3655 opened 11 months ago

surya3655 commented 11 months ago

Description

I have encountered an issue when creating a custom view using the 'View,' 'Grid,' or other view elements and applying a gradient color to the background. The problem arises when attempting to clip the view, specifically on iOS and macOS platforms. The gradient color is not rendered correctly, resulting in unexpected visual artifacts.

I checked this sample on Android and Windows it works fine. Output: image

Expected Output image

Steps to Reproduce

  1. Create a custom view using the 'View,' 'Grid,' or other relevant view elements.
  2. Clip the view using the geometry.
  3. Load control in the XAML page, set Height width and Background to gradient color.

Link to public reproduction project repository

https://github.com/surya3655/View-Clip-Issue

Version with bug

8.0.0-rc.2.9530

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

8.0.0-rc.2.9511

Affected platforms

iOS, macOS

Affected platform versions

macos 14.0.8477-net8-rc2.2/8.0.100-rc.2 SDK 8.0.100-rc.2 maui-ios 8.0.0-rc.2.9530/8.0.100-rc.2 SDK 8.0.100-rc.2

Did you find any workaround?

No response

Relevant log output

No response

XamlTest commented 10 months ago

Verified this on Visual Studio Enterprise 17.9.0 Preview 2(8.0.3). Repro on iOS 17.0 and MacCatalyst, not repro on Windows 11 and Android 14.0-API34 with below Project: ViewClipIssue.zip