LCL: made IsEmptyRect winapi compatible, Rect(0,0,0,0) is just an example of an empty rect (bug #9495)

git-svn-id: trunk@11859 -
This commit is contained in:
vincents 2007-08-24 20:29:59 +00:00
parent 04a5b4539c
commit c01e381286
2 changed files with 10 additions and 4 deletions

View File

@ -3649,8 +3649,12 @@
</element>
<!-- function Visibility: default -->
<element name="IsRectEmpty">
<short/>
<descr/>
<short>Returns true, if the rectangle is empty</short>
<descr>IsEmptyRect returns true, if the area of the rectangle described by ARect is empty,
i.e. right coordinate is less than or equal to the left coordinate,
or the bottom coordinate is less than or equal to the top coordinate
</descr>
<errors/>
<seealso/>
</element>

View File

@ -1152,12 +1152,14 @@ end;
Params: const lprc: TRect
Returns: Boolean
Returns true if ARect is (0,0,0,0)
Returns true if ARect is the area of the rectangle is empty,
i.e. right coordinate is less than or equal to the left coordinate,
or the bottom coordinate is less than or equal to the top coordinate
------------------------------------------------------------------------------}
function IsRectEmpty(const ARect: TRect): Boolean;
begin
with ARect do
Result := (Left = 0) and (Top = 0) and (Right = 0) and (Bottom = 0);
Result := (Right <= Left) or (Bottom <= Top);
end;
{------------------------------------------------------------------------------