Fix deadlock in editor when using snap to the group with actor that has empty bounds

#1971
This commit is contained in:
Wojtek Figat
2023-11-21 12:34:06 +01:00
parent 0db259e300
commit d01990e3bb

View File

@@ -111,7 +111,8 @@ namespace FlaxEditor.Gizmo
if (isSelected) if (isSelected)
{ {
GetSelectedObjectsBounds(out var selectionBounds, out _); GetSelectedObjectsBounds(out var selectionBounds, out _);
ray.Position = ray.GetPoint(selectionBounds.Size.Y * 0.5f); var offset = Mathf.Max(selectionBounds.Size.Y * 0.5f, 1.0f);
ray.Position = ray.GetPoint(offset);
continue; continue;
} }