mirror of
https://github.com/ppy/osu
synced 2025-01-09 15:49:32 +00:00
Add an arbitrary offset to prevent div-by-0
This commit is contained in:
parent
2d4b7dc361
commit
b6b8098b98
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user