xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

[macOs] Image Rotation issue #5395

Closed AndreiMisiukevich closed 5 years ago

AndreiMisiukevich commented 5 years ago

Description

I'd like to animate image with Scale up, Rotate and Scale down animations. Scaling works fine while rotating has wrong behavior.

Steps to Reproduce

Xaml:

<ContentPage>
    <AbsoluteLayout>
        <Image x:Name="logoImage" 
               source="YOUR_TEST_IMAGE_HERE.png"
               AbsoluteLayout.LayoutBounds=".5, .5, 60, 60"
               AbsoluteLayout.LayoutFlags="PositionProportional" />
    </AbsoluteLayout>
</ContentPage>

F# code behind (create cycling animation on appearing)

    override this.OnAppearing () =
        let scaleUpAction = Action<float>(fun v -> logoImage.Scale <- v)
        let scaleDownAction = Action<float>(fun v -> logoImage.Scale <- v)
        let rotateAction = Action<float>(fun v -> logoImage.Rotation <- v)

        let parentAnim = Animation()
        parentAnim.Add(0.0, 0.5, Animation(scaleUpAction, 1., imageScale, Easing.Linear, Action UpdateDotsLabel))
        parentAnim.Add(0.5, 1., Animation(scaleDownAction, imageScale, 1., Easing.Linear, Action UpdateDotsLabel))
        parentAnim.Add(0.9, 1., Animation(rotateAction, 0.0, 360., Easing.Linear, fun _ -> logoImage.Rotation <- 0.0))
        parentAnim.Commit(logoImage, animId, dummyFrequencyRate, animLengthInMilliseconds, Easing.Linear, null, fun _ -> true)

    override this.OnDisappearing() =
        logoImage.AbortAnimation animId |> ignore

Expected Behavior

Should work like on iOS: ios_gif

Actual Behavior

mac_gif

Basic Information

rmarinho commented 5 years ago

Yeah we need to fix the anchor code for macOs

knocte commented 5 years ago

@parceval: you applied to work on a bounty after it has been marked as closed. And @excerebrose had dropped the work before a fix was proposed (and the submitter of the fix didn't apply as a worker on gitcoin). So I'm cancelling the bounty then. If melimion wants to claim it, please write me offline to knocte at gmail dot com indicating nuget version I should test with, cheers.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Cancelled


The funding of 1.131 ETH (205.01 USD @ $181.26/ETH) attached to this issue has been cancelled by the bounty submitter