+ Patch from Graeme Geldenhuys to implement InflateRect

git-svn-id: trunk@4731 -
This commit is contained in:
michael 2006-09-26 13:30:10 +00:00
parent 80b5ecaecd
commit fb0e1df9b4

View File

@ -264,6 +264,7 @@ function UnionRect(var Rect : TRect; const R1,R2 : TRect) : Boolean;
function IsRectEmpty(const Rect : TRect) : Boolean;
function OffsetRect(var Rect : TRect;DX : Integer;DY : Integer) : Boolean;
function CenterPoint(const Rect: TRect): TPoint;
function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean;
implementation
@ -392,5 +393,23 @@ begin
end;
function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean;
begin
if Assigned(@Rect) then
begin
with Rect do
begin
dec(Left, dx);
dec(Top, dy);
inc(Right, dx);
inc(Bottom, dy);
end;
Result := True;
end
else
Result := False;
end;
end.