mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 21:07:33 +08:00
Use the absolute value of ParallaxAmount to make sure we're not scaling stuff down when using a negative ParallaxAmount
This commit is contained in:
parent
567cdc7165
commit
be1159444d
@ -45,7 +45,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
if (!parallaxEnabled)
|
if (!parallaxEnabled)
|
||||||
{
|
{
|
||||||
content.MoveTo(Vector2.Zero, firstUpdate ? 0 : 1000, Easing.OutQuint);
|
content.MoveTo(Vector2.Zero, firstUpdate ? 0 : 1000, Easing.OutQuint);
|
||||||
content.Scale = new Vector2(1 + ParallaxAmount);
|
content.Scale = new Vector2(1 + System.Math.Abs(ParallaxAmount));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@ namespace osu.Game.Graphics.Containers
|
|||||||
double elapsed = MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 1000);
|
double elapsed = MathHelper.Clamp(Clock.ElapsedFrameTime, 0, 1000);
|
||||||
|
|
||||||
content.Position = Interpolation.ValueAt(elapsed, content.Position, offset, 0, 1000, Easing.OutQuint);
|
content.Position = Interpolation.ValueAt(elapsed, content.Position, offset, 0, 1000, Easing.OutQuint);
|
||||||
content.Scale = Interpolation.ValueAt(elapsed, content.Scale, new Vector2(1 + ParallaxAmount), 0, 1000, Easing.OutQuint);
|
content.Scale = Interpolation.ValueAt(elapsed, content.Scale, new Vector2(1 + System.Math.Abs(ParallaxAmount)), 0, 1000, Easing.OutQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
firstUpdate = false;
|
firstUpdate = false;
|
||||||
|
Loading…
Reference in New Issue
Block a user