mirror of https://github.com/ppy/osu
Simplify snap implementation
This commit is contained in:
parent
8d2e852ffd
commit
6fec476147
|
@ -129,10 +129,6 @@ private void applyRotation(bool shouldSnap)
|
|||
TooltipText = newRotation.ToLocalisableString(tooltipFormat);
|
||||
}
|
||||
|
||||
private float snap(float value, float step)
|
||||
{
|
||||
float floor = MathF.Floor(value / step) * step;
|
||||
return value - floor < step / 2f ? floor : floor + step;
|
||||
}
|
||||
private float snap(float value, float step) => MathF.Round(value / step) * step;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue