mirror of
https://gitee.com/handyorg/HandyControl.git
synced 2024-12-02 20:07:56 +08:00
fixed #901
This commit is contained in:
parent
91c10d0b64
commit
7af7d30c56
@ -41,6 +41,12 @@ namespace HandyControl.Controls
|
||||
UpdateContent();
|
||||
}
|
||||
|
||||
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
|
||||
{
|
||||
base.OnRenderSizeChanged(sizeInfo);
|
||||
UpdateContent();
|
||||
}
|
||||
|
||||
private void ElementPanel_SizeChanged(object sender, SizeChangedEventArgs e) => UpdateContent();
|
||||
|
||||
public static readonly DependencyProperty RunawayProperty = DependencyProperty.Register(
|
||||
@ -173,7 +179,7 @@ namespace HandyControl.Controls
|
||||
var duration = double.IsNaN(Speed)
|
||||
? Duration
|
||||
: !MathHelper.IsVerySmall(Speed)
|
||||
? TimeSpan.FromSeconds((to - from) / Speed)
|
||||
? TimeSpan.FromSeconds(Math.Abs(to - from) / Speed)
|
||||
: Duration;
|
||||
|
||||
var animation = new DoubleAnimation(from, to, duration)
|
||||
|
Loading…
Reference in New Issue
Block a user