Browse Source

Merge pull request #2913 from MarchingCube/rect-aabb-allocations

Get rid of allocations in Rect.TransformToAABB
pull/2922/head
Jumar Macato 7 years ago
committed by GitHub
parent
commit
3b38aea2b9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/Avalonia.Visuals/Rect.cs

4
src/Avalonia.Visuals/Rect.cs

@ -371,12 +371,12 @@ namespace Avalonia
/// <returns>The bounding box</returns>
public Rect TransformToAABB(Matrix matrix)
{
var points = new[]
ReadOnlySpan<Point> points = stackalloc Point[4]
{
TopLeft.Transform(matrix),
TopRight.Transform(matrix),
BottomRight.Transform(matrix),
BottomLeft.Transform(matrix),
BottomLeft.Transform(matrix)
};
var left = double.MaxValue;

Loading…
Cancel
Save