Repository navigation
Closed
Labels
difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.kind/bugSomething isn't workingproject/animations 🎡Categorizes an issue or PR as relevant to animations
Description
Current behavior
BeginTime is chopped off duration, ending in animation jump
Expected behavior
Timeline's should take place with the full duration after waiting the BeginTime
How to reproduce it (as minimally and precisely as possible)
Add the following to MainPage.xaml
<Page.Resources>
<Storyboard x:Name="EnterActive">
<DoubleAnimation Storyboard.TargetName="Rec1Transform" Storyboard.TargetProperty="ScaleX"
BeginTime="0:0:0" Duration="0:0:.4" To="1.5">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec1Transform" Storyboard.TargetProperty="ScaleY"
BeginTime="0:0:0" Duration="0:0:.4" To="1.5">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec1Transform" Storyboard.TargetProperty="TranslateX"
BeginTime="0:0:0" Duration="0:0:.4" To="200">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec2Transform" Storyboard.TargetProperty="ScaleX"
BeginTime="0:0:0.1" Duration="0:0:.4" To="1.5">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec2Transform" Storyboard.TargetProperty="ScaleY"
BeginTime="0:0:0.1" Duration="0:0:.4" To="1.5">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec2Transform" Storyboard.TargetProperty="TranslateX"
BeginTime="0:0:0.1" Duration="0:0:.4" To="200">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
<Storyboard x:Name="LeaveActive">
<DoubleAnimation Storyboard.TargetName="Rec1Transform" Storyboard.TargetProperty="ScaleX"
BeginTime="0:0:0.1" Duration="0:0:.4" To="1">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec1Transform" Storyboard.TargetProperty="ScaleY"
BeginTime="0:0:0.1" Duration="0:0:.4" To="1">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec1Transform" Storyboard.TargetProperty="TranslateX"
BeginTime="0:0:0.1" Duration="0:0:.4" To="0">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec2Transform" Storyboard.TargetProperty="ScaleX"
BeginTime="0:0:0.1" Duration="0:0:.4" To="1">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec2Transform" Storyboard.TargetProperty="ScaleY"
BeginTime="0:0:0.1" Duration="0:0:.4" To="1">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
<DoubleAnimation Storyboard.TargetName="Rec2Transform" Storyboard.TargetProperty="TranslateX"
BeginTime="0:0:0.1" Duration="0:0:.4" To="0">
<DoubleAnimation.EasingFunction>
<ExponentialEase EasingMode="EaseInOut"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</Page.Resources>
<Grid Background="Black">
<StackPanel Padding="40" HorizontalAlignment="Left" VerticalAlignment="Center">
<Rectangle Stroke="White" Width="64" Height="64" Margin="24">
<Rectangle.RenderTransform>
<CompositeTransform x:Name="Rec1Transform" ScaleX="1" ScaleY="1" TranslateX="0"/>
</Rectangle.RenderTransform>
</Rectangle>
<Rectangle Stroke="White" Width="64" Height="64" Margin="24">
<Rectangle.RenderTransform>
<CompositeTransform x:Name="Rec2Transform" ScaleX="1" ScaleY="1" TranslateX="0"/>
</Rectangle.RenderTransform>
</Rectangle>
</StackPanel>
</Grid>and the following to MainPage.xaml.cs
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
BeginCycle();
}
private bool isactive = false;
private void BeginCycle()
{
DispatcherTimer timer = new DispatcherTimer();
timer.Interval = TimeSpan.FromSeconds(2);
timer.Tick += (s, e) =>
{
if (isactive)
{
LeaveActive.Begin();
}
else
{
EnterActive.Begin();
}
isactive = !isactive;
};
timer.Start();
}
}Workaround
Don't use BeginTime
Environment
Nuget Package:
- Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
- Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
- Uno.SourceGenerationTasks
- Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
- Other:
Nuget Package Version(s):
3.0.12
3.1.0-dev.327
Affected platform(s):
- iOS
- Android
- WebAssembly
- WebAssembly renderers for Xamarin.Forms
- macOS
- Skia
- WPF
- GTK (Linux)
- Tizen
- Windows
- Build tasks
- Solution Templates
IDE:
- Visual Studio 2017 (version: )
- Visual Studio 2019 (version: 16.7.2)
- Visual Studio for Mac (version: )
- Rider Windows (version: )
- Rider macOS (version: )
- Visual Studio Code (version: )
Relevant plugins:
- Resharper (version: )
Anything else we need to know?
This is from Strix Music. Feel free to message me on Discord with any questions
Reacted by Arlo and Joshua "Yoshi" Askharoun
Metadata
Metadata
Assignees
Labels
difficulty/tbdCategorizes an issue for which the difficulty level needs to be defined.kind/bugSomething isn't workingproject/animations 🎡Categorizes an issue or PR as relevant to animations
Activity
Avid29 commentedon Sep 14, 2020
Here's a gif of my sample in action
You can see how the first animation (growing)
Rectangle1has noBeginTimeand manages to complete its animationFor the second animation (shrinking) both Rectangles have a
BeginTimeso neither plays the animation to completiondr1rrb commentedon Sep 17, 2020
Thanks for the report @Avid29 It's the first time I see this bug and it's really good to know since we are planning to start work on animations
I've linked to the animation epic #3919 so we should tackle it in a near future.