Sign in Join
FPDoc Onlineexperiment

MoveRectToFit procedure

In unit GraphMath

Moves and potentially resizes a rectangle to fit within the specified target rectangle.

Declaration

pascal
procedure MoveRectToFit(var ARect: TRect; const MaxRect: TRect)

Arguments

ARect

TRect instance moved and optionally resized in the routine.

MaxRect

TRect instance where the rectangle is relocated. It also specifies the maximum size for the relocated rectangle.

Description

ARect is the TRect instance repositioned in the routine. Values in the Left, Right, Top, and Bottom members may be updated in the routine if the rectangle is not located within the bounds for the target rectangle.

MaxRect is the TRectangle instance where ARect is repositioned. It also establishes the maximum size for ARect after it has been repositioned. If aRect is larger than MaxRect, ARect is resized to fit with in the constraints in MaxRect.

MoveRectToFit is used in the implementation for the DoDock method in TControl.

Added in LazUtils version 3.0.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.