Skip to content

[Wasm][Skia] DoubleAnimation on Canvas.Top or Canvas.Left is not working #8613

Closed

Description

@jeromelaban

Current behavior

The circle in the repro does not move

Expected behavior

The circle in the repro should move.

How to reproduce it (as minimally and precisely as possible)

https://playground.platform.uno/#122edf61

<Grid>
    <StackPanel>
        <Button x:Name="btnStart" Content="Start" Click="btnStart_Click"></Button>

        <Canvas Height="300" Width="400">
            <Canvas.Background>
                <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Offset="0.0" Color="Cyan" />
                        <GradientStop Offset="1.0" Color="White" />
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Canvas.Background>

            <Ellipse Name="bouncingBall" Height="50" Width="50">
                <behaviors:DynamicAnimation.Storyboard>
                    <Storyboard x:Name="stb">
                        <DoubleAnimation 
                            Storyboard.TargetName="bouncingBall"
                            Storyboard.TargetProperty="(Canvas.Top)"
                            From="0"
                            To="250"
                            Duration="0:0:2"
                            RepeatBehavior="Forever"
                            AutoReverse="True"
                        />

                        <DoubleAnimation 
                            Storyboard.TargetName="bouncingBall"
                            Storyboard.TargetProperty="(Canvas.Left)"
                            From="0"
                            To="350"
                            Duration="0:0:15"
                            RepeatBehavior="Forever"
                        />

                        <!-- this is applied properly -->
                        <ObjectAnimationUsingKeyFrames
                            Storyboard.TargetName="bouncingBall"
                            Storyboard.TargetProperty="Opacity">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="0.5" />
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </behaviors:DynamicAnimation.Storyboard>

                <Ellipse.Fill>
                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                        <LinearGradientBrush.GradientStops>
                            <GradientStop Color="White" Offset="0.0" />
                            <GradientStop Color="Red" Offset="0.75" />
                            <GradientStop Color="DarkRed" Offset="1.0" />
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Ellipse.Fill>
            </Ellipse>
        </Canvas>
    </StackPanel>
</Grid>

Workaround

Set EnableDependentAnimation="True" on the DoubleOpacity animations.

Versions

Uno 4.2.6

Activity

  1. added
    kind/bug
    triage/untriaged
    difficulty/tbd
    project/animations 🎡
    difficulty/challenging 🤯
    and removed
    triage/untriaged
    difficulty/tbd
    on Apr 25, 2022
  2. changed the title [-][Wasm] `DoubleAnimation` on `Canvas.Top` or `Canvas.Left` is not working[/-] [+][Wasm][Skia] `DoubleAnimation` on `Canvas.Top` or `Canvas.Left` is not working[/+] on Apr 27, 2022
  3. added
    platform/wasm 🌐
    area/skia ✏️
    on Apr 27, 2022
  4. jeromelaban commented on Apr 27, 2022

    @jeromelaban
    MemberAuthor

    @dr1rrb The issue is caused by animations being skipped because of this:

    if (!EnableDependentAnimation && this.GetIsDependantAnimation())

    Should we be enabling dependent animations on Skia/Wasm until we get actual Compositor based animations?

  5. dr1rrb commented on Jul 19, 2022

    @dr1rrb
    Member

    Well I don't think that we should enable them by default. Even if currently we are animating on dispatcher, we should run only animations that "should" be independent (unless flag has been enabled in the app).

  6. MartinZikmund commented on May 16, 2023

    @MartinZikmund
    Member

    Closing in favor of #12301, as this is present on all targets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/skia ✏️difficulty/challenging 🤯kind/bugplatform/wasm 🌐project/animations 🎡

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions