rotorgames / Rg.Plugins.Popup

Xamarin Forms popup plugin
MIT License
1.15k stars 337 forks source link

Fixed issue with ScaleX error on Android 9 and 11 #670

Closed zinvob closed 3 years ago

zinvob commented 3 years ago

https://github.com/rotorgames/Rg.Plugins.Popup/issues/407

LuckyDucko commented 3 years ago

@zinvob can you show me how you reproduced the code?

Just curious if instead of the if statement, we could use null-coalesce and null conditional operators to change the code from

_defaultOpacity = page.Opacity;
if (double.IsNaN(_defaultOpacity))
    _defaultOpacity = 1;

to

_defaultOpacity = page?.Opacity ?? 1
zinvob commented 3 years ago

_defaultOpacity = page?.Opacity ?? 1

Page is not null and Opacity is not null (it's NAN). Your sample will just still produce _defaultOpacity = NAN. There must be a NAN check. It seems that this problem is due to the page being partially closed down when checking for Opacity. This seems to give different effects on different versions. On my system I can reproduce it on 9 and 11.

martijn00 commented 3 years ago

@rotorgames My nuget api key has expired. Can you send a new one on Slack or email, or give me direct access to the nuget?

nathankim0 commented 2 years ago

Wow, I found this pr while having a hard time encountering a ScaleX error in v2.0.0.13. The error was resolved after updating to v2.0.0.14. Thank you very much.