Browse Source

* Fix issue ID #38900: union wrongly implemented

git-svn-id: trunk@49376 -
michael 4 years ago
parent
commit
59d4aaf5ec
1 changed files with 3 additions and 2 deletions
  1. 3 2
      rtl/objpas/types.pp

+ 3 - 2
rtl/objpas/types.pp

@@ -686,6 +686,7 @@ begin
   Result.x := apt.X;
   Result.y := apt.Y;
 end;
+
 { TRectF }
 
 function TRectF.GetHeight: Single;
@@ -712,8 +713,8 @@ function TRectF.Union(const r: TRectF): TRectF;
 begin
   result.left:=min(r.left,left);
   result.top:=min(r.top,top);
-  result.right:=min(r.right,right);
-  result.bottom:=min(r.bottom,bottom);
+  result.right:=max(r.right,right);
+  result.bottom:=max(r.bottom,bottom);
 end;
 
 procedure TRectF.Offset(const dx, dy: Single);