mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 10:59:24 +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 IsRectEmpty(const Rect : TRect) : Boolean;
|
||||||
function OffsetRect(var Rect : TRect;DX : Integer;DY : Integer) : Boolean;
|
function OffsetRect(var Rect : TRect;DX : Integer;DY : Integer) : Boolean;
|
||||||
function CenterPoint(const Rect: TRect): TPoint;
|
function CenterPoint(const Rect: TRect): TPoint;
|
||||||
|
function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -392,5 +393,23 @@ begin
|
|||||||
end;
|
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.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user