public bool IsRectCompletelyInside(RectF rect) { return(IsPointInside(rect.TopLeft) && IsPointInside(rect.TopRight) && IsPointInside(rect.BottomLeft) && IsPointInside(rect.BottomRight)); }
public bool Equals(RectF value) { return(RectF.Equals(this, value)); }
public bool IsCompletelyInside(RectF rect) { return(rect.Contains(P1) && rect.Contains(P2) && rect.Contains(P3)); }
public static RectF Inflate(RectF rect, Float width, Float height) { rect.Inflate(width, height); return(rect); }
public static RectF Transform(RectF rect, MatrixF matrix) { MathUtil.TransformRect(ref rect, ref matrix); return(rect); }
public static RectF Offset(RectF rect, Float offsetX, Float offsetY) { rect.Offset(offsetX, offsetY); return(rect); }
public static RectF Inflate(RectF rect, SizeF size) { rect.Inflate(size._width, size._height); return(rect); }
public static RectF Offset(RectF rect, VectorF offsetVector) { rect.Offset(offsetVector.X, offsetVector.Y); return(rect); }
public static RectF Union(RectF rect, PointF point) { rect.Union(new RectF(point, point)); return(rect); }
public static RectF Union(RectF rect1, RectF rect2) { rect1.Union(rect2); return(rect1); }
public static RectF Intersect(RectF rect1, RectF rect2) { rect1.Intersect(rect2); return(rect1); }
internal static void TransformRect(ref RectF rect, ref MatrixF matrix) { if (rect.IsEmpty) { return; } MatrixTypes matrixType = matrix._type; // If the matrix is identity, don't worry. if (matrixType == MatrixTypes.TRANSFORM_IS_IDENTITY) { return; } // Scaling if (0 != (matrixType & MatrixTypes.TRANSFORM_IS_SCALING)) { rect._x *= matrix._m11; rect._y *= matrix._m22; rect._width *= matrix._m11; rect._height *= matrix._m22; // Ensure the width is always positive. For example, if there was a reflection about the // y axis followed by a translation into the visual area, the width could be negative. if (rect._width < 0.0) { rect._x += rect._width; rect._width = -rect._width; } // Ensure the height is always positive. For example, if there was a reflection about the // x axis followed by a translation into the visual area, the height could be negative. if (rect._height < 0.0F) { rect._y += rect._height; rect._height = -rect._height; } } // Translation if (0 != (matrixType & MatrixTypes.TRANSFORM_IS_TRANSLATION)) { // X rect._x += matrix._offsetX; // Y rect._y += matrix._offsetY; } if (matrixType == MatrixTypes.TRANSFORM_IS_UNKNOWN) { // Al Bunny implementation. PointF point0 = matrix.Transform(rect.TopLeft); PointF point1 = matrix.Transform(rect.TopRight); PointF point2 = matrix.Transform(rect.BottomRight); PointF point3 = matrix.Transform(rect.BottomLeft); // Width and height is always positive here. rect._x = Math.Min(Math.Min(point0.X, point1.X), Math.Min(point2.X, point3.X)); rect._y = Math.Min(Math.Min(point0.Y, point1.Y), Math.Min(point2.Y, point3.Y)); rect._width = Math.Max(Math.Max(point0.X, point1.X), Math.Max(point2.X, point3.X)) - rect._x; rect._height = Math.Max(Math.Max(point0.Y, point1.Y), Math.Max(point2.Y, point3.Y)) - rect._y; } }