Fixed An issue with Microsoft.Maui.Animations when testing a custom busy indicator control. #26051
+9
−7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Details
The custom busy indicator control disappears after some time (approx 16 seconds) on iOS and macOS.
Root Cause
Invalid valid value for start and end angle was passed to the PlatformDrawArc method. As a result, the indicator disappears from view and below message is displayed in the debug console.
Error Message
Maui.Controls.Sample.Sandbox[49285:546706] [Unknown process name] CGPathAddArc: invalid value for start or end angle.
Description of Change
Debugging session
2024-11-18 16:24:18.799770+0530 Maui.Controls.Sample.Sandbox[49285:546706] startAngle: -359685 endAngle: -359725 2024-11-18 16:24:18.800034+0530 Maui.Controls.Sample.Sandbox[49285:546706] Drawing arc from 6282.732 to 6283.4297 2024-11-18 16:24:18.800189+0530 Maui.Controls.Sample.Sandbox[49285:546706] [Unknown process name] CGPathAddArc: invalid value for start or end angle.
The values 6282.732 and 6283.4297 (radians) far exceed the proper radians (approximately 6.2832). These values are derived from a significantly negative start and end angle in degrees (-359685° and -359725°), converted to radians.
Bringing them into the 0 to 2π range before using them in your drawing logic resolves the issue.
Validated the behaviour in the following platforms
Issues Fixed
Fixes #22055
Output
Before.IOS.mov
After.IOS.mov
Before.MAC.mov
After.Mac.mov