1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 09:07:25 +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 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;

View File

@ -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);