record TFloatRect

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TFloatRect = record

Description

General-purpose floating-point rectangle POD type defined by top and left margins, width and height.

Overview

Fields

Left: VectorFloat;
Top: VectorFloat;
Width: VectorFloat;
Height: VectorFloat;
TopLeft: TPoint2f;
Size: TPoint2f;

Methods

class function ClipCoords(const SourceSize, DestSize: TPoint2f; var SourceRect, DestRect: TFloatRect): Boolean; static;
function Contains(const Rect: TFloatRect): Boolean; overload; inline;
function Contains(const Point: TPoint2f): Boolean; overload;
function Empty: Boolean;
function Inflate(const Delta: TPoint2f): TFloatRect; overload;
function Inflate(const DeltaX, DeltaY: VectorFloat): TFloatRect; overload; inline;
function Intersect(const Rect: TFloatRect): TFloatRect;
function Offset(const DeltaX, DeltaY: VectorFloat): TFloatRect; overload; inline;
function Offset(const Delta: TPoint2f): TFloatRect; overload;
function Overlaps(const Rect: TFloatRect): Boolean;
function ToInt: TIntRect;
function Union(const Rect: TFloatRect): TFloatRect;

Properties

property Bottom: VectorFloat read GetBottom write SetBottom;
property BottomRight: TPoint2f read GetBottomRight write SetBottomRight;
property Right: VectorFloat read GetRight write SetRight;

Description

Fields

Left: VectorFloat;

Left position of the rectangle.

Top: VectorFloat;

Top position of the rectangle.

Width: VectorFloat;

Width of the rectangle.

Height: VectorFloat;

Height of the rectangle.

TopLeft: TPoint2f;

Top/left corner (position) of the rectangle.

Size: TPoint2f;

Size of the rectangle.

Methods

class function ClipCoords(const SourceSize, DestSize: TPoint2f; var SourceRect, DestRect: TFloatRect): Boolean; static;

Takes source and destination sizes, source and destination rectangles, then applies clipping to ensure that final rectangle stays within valid boundaries of both source and destination sizes.

function Contains(const Rect: TFloatRect): Boolean; overload; inline;

Tests whether the given rectangle is contained within current rectangle.

function Contains(const Point: TPoint2f): Boolean; overload;

Tests whether the given point is inside specified current rectangle.

function Empty: Boolean;

Tests whether the rectangle is empty, that is, having width and height of zero or less.

function Inflate(const Delta: TPoint2f): TFloatRect; overload;

Returns rectangle with left and top decremented, while right and bottom incremented by given offset.

function Inflate(const DeltaX, DeltaY: VectorFloat): TFloatRect; overload; inline;

Returns rectangle with left and top decremented, while right and bottom incremented by given offset.

function Intersect(const Rect: TFloatRect): TFloatRect;

Calculates rectangle that results from intersection between current and the given rectangles.

function Offset(const DeltaX, DeltaY: VectorFloat): TFloatRect; overload; inline;

Displaces current rectangle by each of the given offset values.

function Offset(const Delta: TPoint2f): TFloatRect; overload;

Displaces current rectangle by the given offset.

function Overlaps(const Rect: TFloatRect): Boolean;

Tests whether the given rectangle overlaps current one.

function ToInt: TIntRect;

Converts floating-point rectangle to integer rectangle by rounding margins down.

function Union(const Rect: TFloatRect): TFloatRect;

Calculates rectangle that results from union between current and the given rectangles.

Properties

property Bottom: VectorFloat read GetBottom write SetBottom;

Bottom (non-inclusive) margin of the rectangle.

property BottomRight: TPoint2f read GetBottomRight write SetBottomRight;

Bottom/right (non-inclusive) corner of the rectangle.

property Right: VectorFloat read GetRight write SetRight;

Right (non-inclusive) margin of the rectangle.


Copyright © 2000 - 2017 Yuriy Kotsarenko. Help files generated by PasDoc.