mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-05 14:58:16 +02:00
UnionRect now looks to empty source rects
git-svn-id: trunk@8318 -
This commit is contained in:
parent
d8df871a10
commit
277243a09e
@ -1355,11 +1355,18 @@ end;
|
||||
function UnionRect(var DestRect: TRect;
|
||||
const SrcRect1, SrcRect2: TRect): Boolean;
|
||||
begin
|
||||
Result := True;
|
||||
DestRect.Left := Min(SrcRect1.Left, SrcRect2.Left);
|
||||
DestRect.Top := Min(SrcRect1.Top, SrcRect2.Top);
|
||||
DestRect.Right := Max(SrcRect1.Right, SrcRect2.Right);
|
||||
DestRect.Bottom := Max(SrcRect1.Bottom, SrcRect2.Bottom);
|
||||
if IsRectEmpty(SrcRect1) then
|
||||
DestRect := SrcRect2
|
||||
else
|
||||
if IsRectEmpty(SrcRect2) then
|
||||
DestRect := SrcRect1
|
||||
else begin
|
||||
DestRect.Left := Min(SrcRect1.Left, SrcRect2.Left);
|
||||
DestRect.Top := Min(SrcRect1.Top, SrcRect2.Top);
|
||||
DestRect.Right := Max(SrcRect1.Right, SrcRect2.Right);
|
||||
DestRect.Bottom := Max(SrcRect1.Bottom, SrcRect2.Bottom);
|
||||
end;
|
||||
Result := not IsRectEmpty(DestRect);
|
||||
end;
|
||||
|
||||
//##apiwiz##epi## // Do not remove
|
||||
|
Loading…
Reference in New Issue
Block a user