question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Animations start with a one-frame delay in Avalonia 11

See original GitHub issue

Describe the bug As of Avalonia 11 preview 1, controls are rendered for a single frame before animations begin. This is very noticeable if the animation is fading the control in by changing its opacity.

This does not happen in Avalonia 0.10.18

To Reproduce Paste the following XAML into a new window, run it, and click the button:

<Grid RowDefinitions="Auto,*">
    <ToggleButton Name="Toggle">Begin animation</ToggleButton>
    <Border Grid.Row="1" Background="Red" IsVisible="{Binding IsChecked, ElementName=Toggle}">
        <Border.Styles>
            <Style Selector="Border[IsVisible=true]">
                <Style.Animations>
                    <Animation Duration="0:0:1">
                        <KeyFrame Cue="0%">
                            <Setter Property="Opacity" Value="0.0"/>
                        </KeyFrame>
                        <KeyFrame Cue="90%">
                            <Setter Property="Opacity" Value="0.0"/>
                        </KeyFrame>
                        <KeyFrame Cue="100%">
                            <Setter Property="Opacity" Value="1.0"/>
                        </KeyFrame>
                    </Animation>
                </Style.Animations>
            </Style>
        </Border.Styles>
    </Border>
</Grid>

You will see the red border flicker on-screen as soon as the button is clicked.

Expected behavior When the control’s becomes visible its opacity is immediately set to zero, and no red border is drawn until the animation starts to raise the opacity value (after 900ms).

Desktop (please complete the following information):

  • OS: Windows
  • Version: 11 preview 1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
TomEdwardsEnscapecommented, Jul 3, 2023

This is already a bug report containing a reproducible sample. We’re going to open a new issue via the paid support channel later today.

0reactions
timuniecommented, Aug 15, 2023
Read more comments on GitHub >

github_iconTop Results From Across the Web

Animations
Animations. There are two types of animations in Avalonia UI: Keyframe Animation - can change one or more property values using a timeline....
Read more >
An internet points out that Hackernews' favorite text editor ...
To be fair, the conversation had already shifted to X11/Wayland. GNOME does have a history of starting over from scratch every few years;...
Read more >
018. Avalonia UI - Animating Over Time (To 100% Height)
Support me in my journey to giving back to the industry all my knowledge and helping the world with what I do. Spreading...
Read more >
Untitled
Immigration between 1840 and 1860, Relay starter kereta, Westwood 1 radio stream, ... Kurs oficerski bor, Supa strikas starting 11, Clara zuquete!
Read more >
Hey I'm new to programming and I just watched a video ...
Right now if you jump, the update to the velocity is delayed by one frame. Because you update the velocity with controller.Move and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found