mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 01:06:02 +02:00
* Patch from Graeme Geldenhuys:
- removed the SIZE = TSize declaration from types.pp - Added two new Size() functions that work the same as Rect(), Bounds() or Point(). git-svn-id: trunk@5464 -
This commit is contained in:
parent
964a98edca
commit
ab2e7337e3
@ -92,7 +92,7 @@ type
|
|||||||
{$endif Windows}
|
{$endif Windows}
|
||||||
PSize = ^TSize;
|
PSize = ^TSize;
|
||||||
tagSIZE = TSize;
|
tagSIZE = TSize;
|
||||||
SIZE = TSize;
|
// SIZE = TSize;
|
||||||
|
|
||||||
|
|
||||||
TSmallPoint =
|
TSmallPoint =
|
||||||
@ -264,6 +264,8 @@ 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;
|
function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean;
|
||||||
|
function Size(AWidth, AHeight: Integer): TSize;
|
||||||
|
function Size(ARect: TRect): TSize;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -391,7 +393,6 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean;
|
function InflateRect(var Rect: TRect; dx: Integer; dy: Integer): Boolean;
|
||||||
begin
|
begin
|
||||||
if Assigned(@Rect) then
|
if Assigned(@Rect) then
|
||||||
@ -409,6 +410,18 @@ begin
|
|||||||
Result := False;
|
Result := False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function Size(AWidth, AHeight: Integer): TSize;
|
||||||
|
begin
|
||||||
|
Result.cx := AWidth;
|
||||||
|
Result.cy := AHeight;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function Size(ARect: TRect): TSize;
|
||||||
|
begin
|
||||||
|
Result.cx := ARect.Right - ARect.Left;
|
||||||
|
Result.cy := ARect.Bottom - ARect.Top;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user