1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 03:43:21 +08:00

Tiny refactor

This commit is contained in:
Opelkuh 2021-09-14 00:16:42 +02:00
parent b009772206
commit 9fd616c578
2 changed files with 7 additions and 7 deletions

View File

@ -149,6 +149,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
private double velocityFrameLength; private double velocityFrameLength;
private Vector2 totalPosDifference; private Vector2 totalPosDifference;
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
protected override bool OnMouseMove(MouseMoveEvent e) protected override bool OnMouseMove(MouseMoveEvent e)
{ {
if (cursorScreenPosition == null) if (cursorScreenPosition == null)
@ -174,8 +176,6 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy
return base.OnMouseMove(e); return base.OnMouseMove(e);
} }
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => true;
private void resetVelocityCalculation() private void resetVelocityCalculation()
{ {
cursorScreenPosition = null; cursorScreenPosition = null;

View File

@ -132,10 +132,10 @@ namespace osu.Game.Graphics
height); height);
var quad = new Quad( var quad = new Quad(
rotatePosition(rect.TopLeft, rect.Centre, angle), transformPosition(rect.TopLeft, rect.Centre, angle),
rotatePosition(rect.TopRight, rect.Centre, angle), transformPosition(rect.TopRight, rect.Centre, angle),
rotatePosition(rect.BottomLeft, rect.Centre, angle), transformPosition(rect.BottomLeft, rect.Centre, angle),
rotatePosition(rect.BottomRight, rect.Centre, angle) transformPosition(rect.BottomRight, rect.Centre, angle)
); );
DrawQuad(Texture, quad, DrawColourInfo.Colour.MultiplyAlpha(alpha), null, vertexAction, 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 cos = MathF.Cos(angle);
float sin = MathF.Sin(angle); float sin = MathF.Sin(angle);