Skip to content

Commit

Permalink
fix(rect_union): Fixed a calculation bug with .Union on Rect class.
Browse files Browse the repository at this point in the history
  • Loading branch information
carldebilly committed Jul 10, 2021
1 parent ee6ed7f commit 2425c81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Uno.Foundation/Rect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ public void Intersect(Rect rect)
public void Union(Rect rect)
{
var left = Math.Min(Left, rect.Left);
var right = Math.Max(left + Width, rect.Right);
var right = Math.Max(Left + Width, rect.Right);
var top = Math.Min(Top, rect.Top);
var bottom = Math.Max(top + Height, rect.Bottom);
var bottom = Math.Max(Top + Height, rect.Bottom);
this = new Rect(left, top, right - left, bottom - top);
}

Expand Down

0 comments on commit 2425c81

Please sign in to comment.