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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
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; |
|
|
|
|