1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 17:52:56 +08:00

Fix ParallaxContainer breaking with no mouse state present.

This commit is contained in:
Dean Herbert 2017-02-09 19:25:04 +09:00
parent e0b7517535
commit becb65f702
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49

View File

@ -45,7 +45,8 @@ namespace osu.Game.Graphics.Containers
{
base.Update();
content.MoveTo((ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2) * ParallaxAmount, firstUpdate ? 0 : 1000, EasingTypes.OutQuint);
Vector2 offset = input.CurrentState.Mouse == null ? Vector2.Zero : ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2;
content.MoveTo(offset * ParallaxAmount, firstUpdate ? 0 : 1000, EasingTypes.OutQuint);
content.Scale = new Vector2(1 + ParallaxAmount);
firstUpdate = false;