mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 09:07:25 +08:00
Tiny refactor
This commit is contained in:
parent
b009772206
commit
9fd616c578
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user