From 9fd616c578107ab375fa102ab313a6d5f40a34cf Mon Sep 17 00:00:00 2001 From: Opelkuh <25430283+Opelkuh@users.noreply.github.com> Date: Tue, 14 Sep 2021 00:16:42 +0200 Subject: [PATCH] Tiny refactor --- .../Skinning/Legacy/LegacyCursorParticles.cs | 4 ++-- osu.Game/Graphics/ParticleSpewer.cs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorParticles.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorParticles.cs index 95c2a6b930..8dc486285b 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorParticles.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorParticles.cs @@ -149,6 +149,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy private double velocityFrameLength; private Vector2 totalPosDifference; + public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; + protected override bool OnMouseMove(MouseMoveEvent e) { if (cursorScreenPosition == null) @@ -174,8 +176,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy return base.OnMouseMove(e); } - public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true; - private void resetVelocityCalculation() { cursorScreenPosition = null; diff --git a/osu.Game/Graphics/ParticleSpewer.cs b/osu.Game/Graphics/ParticleSpewer.cs index 544b2bd2ed..8b82dfb7c6 100644 --- a/osu.Game/Graphics/ParticleSpewer.cs +++ b/osu.Game/Graphics/ParticleSpewer.cs @@ -132,10 +132,10 @@ namespace osu.Game.Graphics height); var quad = new Quad( - rotatePosition(rect.TopLeft, rect.Centre, angle), - rotatePosition(rect.TopRight, rect.Centre, angle), - rotatePosition(rect.BottomLeft, rect.Centre, angle), - rotatePosition(rect.BottomRight, rect.Centre, angle) + transformPosition(rect.TopLeft, rect.Centre, angle), + transformPosition(rect.TopRight, rect.Centre, angle), + transformPosition(rect.BottomLeft, rect.Centre, angle), + transformPosition(rect.BottomRight, rect.Centre, angle) ); DrawQuad(Texture, quad, DrawColourInfo.Colour.MultiplyAlpha(alpha), null, vertexAction, @@ -144,7 +144,7 @@ namespace osu.Game.Graphics } } - private Vector2 rotatePosition(Vector2 pos, Vector2 centre, float angle) + private Vector2 transformPosition(Vector2 pos, Vector2 centre, float angle) { float cos = MathF.Cos(angle); float sin = MathF.Sin(angle);