Skip to content

TRectF

Declaration

Source position: types.pp line 269

type
  TRectF = packed record
    constructor Create(Origin: TPointF);
    constructor Create(Origin: TPointF; AWidth: Single; AHeight: Single);
    constructor Create(ALeft: Single; ATop: Single; ARight: Single; 
                  ABottom: Single);
    constructor Create(P1: TPointF; P2: TPointF; Normalize: Boolean=False);
    constructor Create(R: TRectF; Normalize: Boolean=False);
    constructor Create(R: TRect; Normalize: Boolean=False);
    class operator =(L: TRectF; R: TRectF) : Boolean;
    class operator <>(L: TRectF; R: TRectF) : Boolean;
    class operator +(L: TRectF; R: TRectF) : TRectF;
    class operator *(L: TRectF; R: TRectF) : TRectF;
    class operator :=(const arc: TRect) : TRectF;
    class function Empty : TRectF;
    class function Intersect(R1: TRectF; R2: TRectF) : TRectF;
    procedure Intersect(R: TRectF);
    class function Union
                    (const Points: Array of TPointF = packed record
public
  x : Single;
  y : Single;
  Add;
  function Distance(const apt: TPointF) : Single;
  function DotProduct(const apt: TPointF) : Single;
  function IsZero : Boolean;
  Subtract;
  SetLocation;
  Offset;
  EqualsTo;
  function Scale(afactor: Single) : TPointF;
  function Ceiling : TPoint;
  function Truncate : TPoint;
  function Floor : TPoint;
  function Round : TPoint;
  function &Length : Single;
  function Rotate(angle: single) : TPointF;
  function Reflect(const normal: TPointF) : TPointF;
  function MidPoint(const b: TPointF) : TPointF;
  PointInCircle;
  class function Zero : TPointF;  static;
  function Angle(const b: TPointF) : Single;
  function AngleCosine(const b: TPointF) : single;
  function CrossProduct(const apt: TPointF) : Single;
  function Normalize : TPointF;
  ToString;
  Create;
  TPointF.class operator =(const apt1: TPointF; const apt2: TPointF)
                           : Boolean;
  TPointF.class operator <>(const apt1: TPointF; const apt2: TPointF)
                            : Boolean;
  TPointF.class operator +(const apt1: TPointF; const apt2: TPointF)
                           : TPointF;
  TPointF.class operator -(const apt1: TPointF; const apt2: TPointF)
                           : TPointF;
  TPointF.class operator -(const apt1: TPointF) : TPointF;
  TPointF.class operator *(const apt1: TPointF; const apt2: TPointF)
                           : TPointF;
  TPointF.class operator *(const apt1: TPointF; afactor: single) : TPointF;
  TPointF.class operator *(afactor: single; const apt1: TPointF) : TPointF;
  TPointF.class operator /(const apt1: TPointF; afactor: single) : TPointF;
  TPointF.class operator :=(const apt: TPoint) : TPointF;
  TPointF.class operator **(const apt1: TPointF; const apt2: TPointF)
                            : Single;
end
)
                     : TRectF;
    class function Union(R1: TRectF; R2: TRectF) : TRectF;
    procedure Union(const r: TRectF);
    function Ceiling : TRectF;
    function CenterAt : TRectF;
    function CenterPoint : TPointF;
    function Contains(Pt: TPointF) : Boolean;
    function Contains(R: TRectF) : Boolean;
    function EqualsTo : Boolean;
    function Fit : Single;
    function FitInto(const Dest: TRectF) : TRectF; overload;
    function FitInto(const Dest: TRectF; out Ratio: Single) : TRectF; overload;
    function IntersectsWith : Boolean;
    function IsEmpty : Boolean;
    function PlaceInto : TRectF;
    function Round : TRect;
    function SnapToPixel : TRectF;
    function Truncate : TRect;
    procedure Inflate(DL: Single; DT: Single; DR: Single; DB: Single);
    procedure Inflate(DX: Single; DY: Single);
    procedure Normalize;
    procedure NormalizeRect;
    procedure Offset(const dx: Single; const dy: Single);
    procedure Offset(DP: TPointF);
    procedure SetLocation(P: TPointF);
    procedure SetLocation(X: Single; Y: Single);
    function ToString(aSize: Byte; aDecimals: Byte; aUseSize: Boolean=False)
                  : RTLString; overload;
    function ToString(aUseSize: Boolean=False) : RTLString; overload;
    property Width: Single; {rw}
    property Height: Single; {rw}
    property Size: TSizeF; {rw}
    property Location: TPointF; {rw}
    case Integer of
      0: (
        Left : Single;
        Top : Single;
        Right : Single;
        Bottom : Single;
      );
      1: (
        TopLeft : TPointF;
        BottomRight : TPointF;
      );
  end;