record TIntRect
Unit
PXL.Types
Declaration
type TIntRect = record
Description
General-purpose integer rectangle POD type defined by top and left margins, width and height.
Overview
Fields
Methods
Properties
Description
Fields
Left: VectorInt; |
|
Left position of the rectangle.
|
Top: VectorInt; |
|
Top position of the rectangle.
|
TopLeft: TPoint2i; |
|
Top/left corner (position) of the rectangle.
|
Methods
class function ClipCoords(const SourceSize, DestSize: TPoint2i; var SourceRect: TIntRect; var DestPos: TPoint2i): Boolean; static; |
|
Takes source and destination sizes, source rectangle and destination position, then applies clipping to ensure that final rectangle stays within valid boundaries of both source and destination sizes.
|
function Contains(const Rect: TIntRect): Boolean; overload; inline; |
|
Tests whether the given rectangle is contained within current rectangle.
|
function Contains(const Point: TPoint2i): Boolean; overload; inline; |
|
Tests whether the given point is inside specified current rectangle.
|
function Empty: Boolean; inline; |
|
Tests whether the rectangle is empty, that is, having width and height of zero or less.
|
function Inflate(const Delta: TPoint2i): TIntRect; overload; inline; |
|
Returns rectangle with left and top decremented, while right and bottom incremented by given offset.
|
function Inflate(const DeltaX, DeltaY: VectorInt): TIntRect; overload; |
|
Returns rectangle with left and top decremented, while right and bottom incremented by given offset.
|
function Intersect(const Rect: TIntRect): TIntRect; inline; |
|
Calculates rectangle that results from intersection between current and the given rectangles.
|
function Offset(const DeltaX, DeltaY: VectorInt): TIntRect; overload; inline; |
|
Displaces current rectangle by each of the given offset values.
|
function Offset(const Delta: TPoint2i): TIntRect; overload; inline; |
|
Displaces current rectangle by the given offset.
|
function Overlaps(const Rect: TIntRect): Boolean; inline; |
|
Tests whether the given rectangle overlaps current one.
|
function Union(const Rect: TIntRect): TIntRect; inline; |
|
Calculates rectangle that results from union between current and the given rectangles.
|
Properties
property Bottom: VectorInt read GetBottom write SetBottom; |
|
Bottom (non-inclusive) margin of the rectangle.
|
property BottomRight: TPoint2i read GetBottomRight write SetBottomRight; |
|
Bottom/right (non-inclusive) corner of the rectangle.
|
property Right: VectorInt read GetRight write SetRight; |
|
Right (non-inclusive) margin of the rectangle.
|
Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.
|