mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 19:22:54 +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);
|
TooltipText = newRotation.ToLocalisableString(tooltipFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
private float snap(float value, float step)
|
private float snap(float value, float step) => MathF.Round(value / step) * step;
|
||||||
{
|
|
||||||
float floor = MathF.Floor(value / step) * step;
|
|
||||||
return value - floor < step / 2f ? floor : floor + step;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user