[Overview][Constants][Types][Classes][Procedures and functions][Variables] Reference for unit 'Objects' (#rtl)

TRect.Grow

Expand rectangle with certain size.

Declaration

Source position: objects.pp line 243

procedure TRect.Grow(

  ADX: Sw_Integer;

  ADY: Sw_Integer

);

Description

Growexpands the rectangle with an amount ADXin the Xdirection (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 ADYin the Ydirection (both on the top and the bottom side of the rectangle, adding a length 2*ADY to the height of the rectangle.

ADXand ADYcan be negative. If the resulting rectangle is empty, it is set to the empty rectangle at (0,0).

Errors

None.

See also

TRect.Move

  

Move rectangle along a vector.

Example

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.