mirror of
https://github.com/ppy/osu.git
synced 2025-02-21 03:43:21 +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 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;
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user