Cleanup 5

This commit is contained in:
W2.Wizard
2021-02-21 11:50:30 +01:00
parent ee76440477
commit 694b20148d
30 changed files with 93 additions and 103 deletions

View File

@@ -32,8 +32,11 @@ namespace FlaxEngine.GUI
private bool IntersectsChildContent(CanvasRootControl child, ref Ray ray, out Vector2 childSpaceLocation)
{
// Inline bounds calculations (it will reuse world matrix)
OrientedBoundingBox bounds = new OrientedBoundingBox();
bounds.Extents = new Vector3(child.Size * 0.5f, Mathf.Epsilon);
OrientedBoundingBox bounds = new OrientedBoundingBox
{
Extents = new Vector3(child.Size * 0.5f, Mathf.Epsilon)
};
child.Canvas.GetWorldMatrix(out var world);
Matrix.Translation(bounds.Extents.X, bounds.Extents.Y, 0, out var offset);
Matrix.Multiply(ref offset, ref world, out bounds.Transformation);