* empty Rect does not extend the rect in UnionRect, based on patch provided by Werner Pamler, resolves #40680

This commit is contained in:
florian 2024-07-04 22:40:42 +02:00
parent c96b0f6ca5
commit f67165ae31

View File

@ -874,6 +874,12 @@ end;
function UnionRect(var Rect : TRect;const R1,R2 : TRect) : Boolean;
var
lRect: TRect;
begin
if IsRectEmpty(R1) then
lRect:=R2
else if IsRectEmpty(R2) then
lRect:=R1
else
begin
lRect:=R1;
if R2.Left<R1.Left then
@ -884,6 +890,7 @@ begin
lRect.Right:=R2.Right;
if R2.Bottom>R1.Bottom then
lRect.Bottom:=R2.Bottom;
end;
Result:=not IsRectEmpty(lRect);
if Result then