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

[iOS] [Mac] Fix for Gradient background size is incorrect when invalidating parent #26222

Closed

Conversation

Tamilarasan-Paranthaman
Copy link
Contributor

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman commented Nov 29, 2024

Root Cause of the issue

  • During the initial and dynamic rendering of the view, the Gradient Layer frame is not applied correctly. Additionally, the Gradient Layer frame updates unnecessarily for all UIViews, causing the Gradient Layer to appear incorrectly sized.

Description of Change

  • The issue was resolved by retrieving the superlayer (parent) of the Gradient Layer and updating its bounds to match the Gradient Layer's frame.

Issues Fixed

Fixes #26057
Fixes #20218

Tested the behaviour in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Screenshot

iOS

Before Issue Fix After Issue Fix
iOSGradientIssue.mov
iOSGradientFix.mov

Mac

Before Issue Fix After Issue Fix
MacGradientIssue.mov
MacGradientFix.mov

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 29, 2024
Copy link
Contributor

Hey there @Tamilarasan-Paranthaman! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman changed the title iOS Gradient fix [iOS] [Mac] Fix for Gradient background size is incorrect when invalidating parent Nov 29, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@Tamilarasan-Paranthaman Tamilarasan-Paranthaman marked this pull request as ready for review November 29, 2024 14:40
@Tamilarasan-Paranthaman Tamilarasan-Paranthaman requested a review from a team as a code owner November 29, 2024 14:40
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@kubaflo
Copy link
Contributor

kubaflo commented Dec 2, 2024

Hi, @albyrock87 I remember you were making some changes to this viewExtension.cs when you were working on the border fix. Does this PR look good to you?

@albyrock87
Copy link
Contributor

@kubaflo my PR #24848 should already fix this, at least that's my guess.
Also note that my PR basically gets rid of UpdateBackgroundLayers.

@kubaflo
Copy link
Contributor

kubaflo commented Dec 2, 2024

@albyrock87 I see! Your PR is great! Maybe you should also include a UI test for this issue in your PR as well #24848

@Redth Redth requested a review from Copilot December 4, 2024 21:49

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 6 out of 7 changed files in this pull request and generated no suggestions.

Files not reviewed (1)
  • src/Controls/tests/TestCases.HostApp/Issues/Issue26057.xaml: Language not supported
Comments skipped due to low confidence (1)

src/Controls/tests/TestCases.HostApp/Issues/Issue26057.xaml.cs:16

  • Ensure that 'stack' is properly defined and used within this context. The current snippet does not provide enough information about 'stack'.
(stack as IView).InvalidateMeasure();
@albyrock87
Copy link
Contributor

I will add this UI test on my PR to confirm it fixes this issue too.

@albyrock87
Copy link
Contributor

@Tamilarasan-Paranthaman I've added you as co-author on #24848 where I've just included your UI test and verified it works fine

@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
@jfversluis jfversluis added the area-drawing Shapes, Borders, Shadows, Graphics, BoxView, custom drawing label Dec 9, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 10, 2025
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 community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/iOS 🍎 platform/macOS 🍏 macOS / Mac Catalyst
Projects
None yet
6 participants