Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[iOS/macOS] Same offsets behavior in GradientBrush between platforms #13101

Merged
merged 3 commits into from
Dec 15, 2020

Conversation

jsuarezruiz
Copy link
Contributor

@jsuarezruiz jsuarezruiz commented Dec 10, 2020

Description of Change

On Android, using a GradientDrawable renders the gradient even without setting the offsets. On iOS (or macOS), the gradient does not render without setting the offsets.

This PR adds changes to set the default values in case of not having any offset set in the Brush. In this way, we have the same behavior between different platforms.

Issues Resolved

API Changes

None

Platforms Affected

  • iOS
  • macOS

Behavioral/Visual Changes

None

Before/After Screenshots

Captura de pantalla 2020-12-10 a las 14 00 01

Testing Procedure

Launch Core Gallery and navigate to the Brushes samples. Select the new "GradientBrush Offsets Gallery" to verify that the gradient is rendered in the same way on iOS (and macOS) as on Android.

PR Checklist

  • Targets the correct branch
  • Tests are passing (or failures are unrelated)

@jsuarezruiz jsuarezruiz changed the title [iOS/macOS] Set same offsets behavior in GradientBrush [iOS/macOS] Same offsets behavior in GradientBrush between platforms Dec 10, 2020
@rmarinho rmarinho added the blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. label Dec 11, 2020
@rmarinho rmarinho added this to To do in vNext+1 (5.0.0) via automation Dec 11, 2020
@rmarinho rmarinho added this to the 5.0.0 milestone Dec 11, 2020
@rmarinho rmarinho moved this from To do to In Review in vNext+1 (5.0.0) Dec 11, 2020
Copy link
Contributor

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

Looking at the code, they are the same. Is there no way to move this into a CAUtils or something?

Also, the adjacent GetRadialGradientBrushEndPoint methods differ already. macOS has additional checks that might also be needed in the iOS side. Or at least have some sort of extension method for these types that can be shared if possible.

@jsuarezruiz
Copy link
Contributor Author

@mattleibow Thanks for the feedback!. I have created a shared BrushExtensions class between iOS and macOS. Now GetRadialGradientBrushEndPoint is the same method.

Copy link
Contributor

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

Looking good!

@rmarinho rmarinho merged commit 26497ad into 5.0.0 Dec 15, 2020
vNext+1 (5.0.0) automation moved this from In Review to Done Dec 15, 2020
@rmarinho rmarinho deleted the fix-13092 branch December 15, 2020 19:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/brushes a/frame blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. ControlGallery p/iOS 🍎 p/macOS t/bug 🐛
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

[Bug] Frame.Background not displaying GradientBrush on iOS
4 participants