Bug 1008154 - Make BaseRect::Intersects return false if at least one of the rects is empty. r=roc

This commit is contained in:
Markus Stange 2014-05-11 17:48:32 +02:00
parent 9eea444e74
commit 8dd0c2ffca

View File

@ -92,7 +92,8 @@ struct BaseRect {
// Always returns false if aRect is empty or 'this' is empty.
bool Intersects(const Sub& aRect) const
{
return x < aRect.XMost() && aRect.x < XMost() &&
return !IsEmpty() && !aRect.IsEmpty() &&
x < aRect.XMost() && aRect.x < XMost() &&
y < aRect.YMost() && aRect.y < YMost();
}
// Returns the rectangle containing the intersection of the points