1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-20 21:01:17 +08:00

Merge pull request #33189 from peppy/fix-clock-animation

Fix analog clock animation not animating when hand crosses zero
This commit is contained in:
Bartłomiej Dach
2025-05-19 09:39:45 +02:00
committed by GitHub
Unverified
2 changed files with 19 additions and 1 deletions
@@ -70,8 +70,18 @@ namespace osu.Game.Overlays.Toolbar
float rotation = fraction * 360 - 90;
// The case where a hand is completing a rotation.
// Animate and then move back one full rotation so we don't need to track outside of 0..360
if (Math.Abs(hand.Rotation - rotation) > 180)
hand.RotateTo(rotation);
{
float animRotation = rotation;
while (animRotation < hand.Rotation)
animRotation += 180;
hand.RotateTo(animRotation, duration, Easing.OutElastic)
.Then()
.RotateTo(rotation);
}
else
hand.RotateTo(rotation, duration, Easing.OutElastic);
}
@@ -10,6 +10,14 @@ namespace osu.Game.Overlays.Toolbar
{
private int? lastSecond;
protected override void LoadComplete()
{
base.LoadComplete();
UpdateDisplay(DateTimeOffset.Now);
FinishTransforms(true);
}
protected override void Update()
{
base.Update();