Sign in Join
FPDoc Onlineexperiment

TRect.Grow procedure

Member of TRectIn unit Objects

Expand rectangle with certain size.

Declaration

pascal
procedure Grow(ADX: Sw_Integer; ADY: Sw_Integer)

Description

Grow expands the rectangle with an amount ADX in the X direction (both on the left and right side of the rectangle, thus adding a length 2*ADX to the width of the rectangle), and an amount ADY in the Y direction (both on the top and the bottom side of the rectangle, adding a length 2*ADY to the height of the rectangle.

ADX and ADY can be negative. If the resulting rectangle is empty, it is set to the empty rectangle at (0,0).

Errors

None.

See also

Example: ex6

pascal
Program ex6;

{ Program to demonstrate TRect.Grow }

Uses objects;


Var ARect,BRect : TRect;

begin
  ARect.Assign(10,10,20,20);
  ARect.Grow(5,5);
  // Brect should be where new ARect is.
  BRect.Assign(5,5,25,25);
  If ARect.Equals(BRect) Then
    Writeln ('ARect equals BRect')
  Else
    Writeln ('ARect does not equal BRect !');
end.

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