Skip to content

RotateTo & ScaleTo on Android seems to create a funny rotation/scale. #11852

Open
@FreakyAli

Description

@FreakyAli

Description

The default animation RotateTo method seems to be ignoring the AnchorX and AnchorY property when it's set to 0.5 by default and because of this, it performs a funny rotation on Android. (iOS works as expected).

I have only tested with Android and iOS not sure if this is the case in other platforms as well.

Check the Attached Gif to see how it is instead of how it should be.

Steps to Reproduce

  • Create a Maui app
  • On a VisualElement try using the RotateTo method
  • It seems to ignore the default anchors.
Expected Behavior Actual Behavior

Link to public reproduction project repository

https://github.com/FreakyAli/Maui.FreakyControls/blob/72e03aa3c59174efe6e1f0d061c6d2a5de6f7de8/MAUI.FreakyControls/MAUI.FreakyControls/Shared/FreakyCheckbox/FreakyCheckbox.cs#L91

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 12

Did you find any workaround?

Yes, if you were to add the below code before calling RotateTo, it does work.

if (DevicePlatform.Android == DeviceInfo.Platform)
    skiaView.AnchorY = skiaView.AnchorX = 0.501;
await skiaView.RotateTo(90, 150);

Now here you are setting the Anchor to a value which is a slight bit higher than the default, but this will be invisible to the naked eye.

Let me know if anything else is needed, Thanks!

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-animationAnimation, Transitions, Transformsmigration-compatibilityXamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convertplatform/androids/triagedIssue has been reviewedt/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions