[Overview][Types][Procedures and functions][Index] Reference for unit 'GraphMath' (#lazutils)

MoveRectToFit

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

Declaration

Source position: graphmath.pp line 85

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.

Version info

Added in LazUtils version 3.0.


Version 4.0 Generated 2025-05-03 Home