Simplify snap implementation

This commit is contained in:
Bartłomiej Dach 2023-04-10 14:55:30 +02:00
parent 8d2e852ffd
commit 6fec476147
No known key found for this signature in database
1 changed files with 1 additions and 5 deletions

View File

@ -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;
}
}