mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-06 20:26:13 +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;
|
function UnionRect(var DestRect: TRect;
|
||||||
const SrcRect1, SrcRect2: TRect): Boolean;
|
const SrcRect1, SrcRect2: TRect): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := True;
|
if IsRectEmpty(SrcRect1) then
|
||||||
DestRect.Left := Min(SrcRect1.Left, SrcRect2.Left);
|
DestRect := SrcRect2
|
||||||
DestRect.Top := Min(SrcRect1.Top, SrcRect2.Top);
|
else
|
||||||
DestRect.Right := Max(SrcRect1.Right, SrcRect2.Right);
|
if IsRectEmpty(SrcRect2) then
|
||||||
DestRect.Bottom := Max(SrcRect1.Bottom, SrcRect2.Bottom);
|
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;
|
end;
|
||||||
|
|
||||||
//##apiwiz##epi## // Do not remove
|
//##apiwiz##epi## // Do not remove
|
||||||
|
Loading…
Reference in New Issue
Block a user