mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Simplify snap implementation
This commit is contained in:
parent
8d2e852ffd
commit
6fec476147
@ -129,10 +129,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
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
Block a user