Add an arbitrary offset to prevent div-by-0

This commit is contained in:
smoogipoo 2019-10-16 19:44:53 +09:00
parent 2d4b7dc361
commit b6b8098b98

View File

@ -43,6 +43,10 @@ namespace osu.Game.Screens.Edit.Compose.Components
public override Vector2 GetSnapPosition(Vector2 position)
{
Vector2 direction = position - CentrePosition;
if (direction == Vector2.Zero)
direction = new Vector2(0.001f, 0.001f);
float distance = direction.Length;
float radius = DistanceSpacing;