mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Rely less on zero-duration transform helpers
They have huge overheads. See ppy/osu-framework#1411.
This commit is contained in:
@ -8,6 +8,7 @@ using OpenTK;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Game.Configuration;
|
using osu.Game.Configuration;
|
||||||
using osu.Framework.Configuration;
|
using osu.Framework.Configuration;
|
||||||
|
using osu.Framework.MathUtils;
|
||||||
|
|
||||||
namespace osu.Game.Graphics.Containers
|
namespace osu.Game.Graphics.Containers
|
||||||
{
|
{
|
||||||
@ -61,8 +62,9 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
if (parallaxEnabled)
|
if (parallaxEnabled)
|
||||||
{
|
{
|
||||||
Vector2 offset = input.CurrentState.Mouse == null ? Vector2.Zero : ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2;
|
Vector2 offset = (input.CurrentState.Mouse == null ? Vector2.Zero : ToLocalSpace(input.CurrentState.Mouse.NativeState.Position) - DrawSize / 2) * ParallaxAmount;
|
||||||
content.MoveTo(offset * ParallaxAmount, firstUpdate ? 0 : 1000, Easing.OutQuint);
|
|
||||||
|
content.Position = Interpolation.ValueAt(Clock.ElapsedFrameTime, content.Position, offset, 0, 1000, Easing.OutQuint);
|
||||||
content.Scale = new Vector2(1 + ParallaxAmount);
|
content.Scale = new Vector2(1 + ParallaxAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ namespace osu.Game.Screens.Play
|
|||||||
{
|
{
|
||||||
var xFill = value * UsableWidth;
|
var xFill = value * UsableWidth;
|
||||||
fill.Width = xFill;
|
fill.Width = xFill;
|
||||||
handleBase.MoveToX(xFill);
|
handleBase.X = xFill;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnUserChange() => OnSeek?.Invoke(Current);
|
protected override void OnUserChange() => OnSeek?.Invoke(Current);
|
||||||
|
Reference in New Issue
Block a user