-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Windows]Fixed the ViewExtensions RotateYTo and RotateXTo with length 0 crashes #30167
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
base: main
Are you sure you want to change the base?
Conversation
Hey there @@Ahamed-Ali! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
@@ -37,6 +37,10 @@ public static void UpdateTransformation(this FrameworkElement frameworkElement, | |||
// rotation values are set, but the aforementioned functionality will be lost. | |||
if (Math.Abs(view.RotationX) != 0 || Math.Abs(view.RotationY) != 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any reason this is not
if (Math.Abs(view.RotationX) != 0 || Math.Abs(view.RotationY) != 0) | |
if (Math.Abs(rotationX) != 0 || Math.Abs(rotationY) != 0) |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, I have reused the local variable @MartyIX
if (double.IsNaN(rotationX) || double.IsNaN(rotationY) || double.IsNaN(rotation)) | ||
{ | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw: Given your patch, is it safe to pass NaN here:
Rotation = rotation, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's safe to pass NaN in this case because no mathematical operations are performed on it, so no exception occurs. A valid value will be updated during the subsequent continuous updates. @MartyIX
@@ -0,0 +1,35 @@ | |||
namespace Maui.Controls.Sample.Issues; | |||
|
|||
[Issue(IssueTracker.Github, 18420, "[Windows]ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows", PlatformAffected.UWP)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Issue(IssueTracker.Github, 18420, "[Windows]ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows", PlatformAffected.UWP)] | |
[Issue(IssueTracker.Github, 18420, "[Windows] ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows", PlatformAffected.UWP)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
{ | ||
public Issue18420(TestDevice device) : base(device) { } | ||
|
||
public override string Issue => "[Windows]ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public override string Issue => "[Windows]ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows"; | |
public override string Issue => "[Windows] ViewExtensions RotateYTo and RotateXTo with length 0 crashes on Windows"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
/azp run MAUI-UITests-public |
Azure Pipelines successfully started running 1 pipeline(s). |
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Root Cause of the issue
https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Tweener.cs#L124
Description of Change
Issues Fixed
Fixes #18420
Tested the behaviour in the following platforms
Screenshot
CrashOccured.mp4
NoCrashwithFix.mp4