Bug 394279 - "nsRect::Contains() should always succeed if the parameter rect is empty" [p=bugspam.Callek@gmail.com (Justin Wood [Callek]) r+sr=roc a1.9=mconnor]

This commit is contained in:
reed@reedloden.com 2007-10-12 16:12:16 -07:00
parent b8c0effac5
commit 80990f6596

View File

@ -60,10 +60,12 @@ PRBool nsRect::Contains(nscoord aX, nscoord aY) const
(aX < XMost()) && (aY < YMost()));
}
//Also Returns true if aRect is Empty
PRBool nsRect::Contains(const nsRect &aRect) const
{
return (PRBool) ((aRect.x >= x) && (aRect.y >= y) &&
(aRect.XMost() <= XMost()) && (aRect.YMost() <= YMost()));
return aRect.IsEmpty() ||
((PRBool) ((aRect.x >= x) && (aRect.y >= y) &&
(aRect.XMost() <= XMost()) && (aRect.YMost() <= YMost())));
}
// Intersection. Returns TRUE if the receiver overlaps aRect and