mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 17:49:27 +02:00
+ Patch from Graeme Geldenhuys to implement InflateRect
git-svn-id: trunk@4731 -
This commit is contained in:
parent
80b5ecaecd
commit
fb0e1df9b4
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user