// Scale path to 1x1 public static void ScaleToReferenceWorld(this List<Vector2> positions) { Rectangle boundingRectangle = positions.BoundingRectangle(); for (int i = 0; i < positions.Count; i++) { Vector2 position = positions[i]; position.X *= (1.0f / boundingRectangle.Width); position.Y *= (1.0f / boundingRectangle.Height); positions[i] = position; } }
// Check bounding rectangle size public static bool IsLargeEnough(this List<Vector2> positions, float minSize) { Rectangle boundingRectangle = positions.BoundingRectangle(); return boundingRectangle.Width > minSize && boundingRectangle.Height > minSize; }