mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 620658: Add nsRegion::Contains(nsRegion). sr=roc
This commit is contained in:
parent
d5e0476347
commit
ef159da4a5
@ -1013,6 +1013,18 @@ PRBool nsRegion::Contains (const nsRect& aRect) const
|
|||||||
return tmpRgn.IsEmpty();
|
return tmpRgn.IsEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRBool nsRegion::Contains (const nsRegion& aRgn) const
|
||||||
|
{
|
||||||
|
// XXX this could be made faster
|
||||||
|
nsRegionRectIterator iter(aRgn);
|
||||||
|
while (const nsRect* r = iter.Next()) {
|
||||||
|
if (!Contains (*r)) {
|
||||||
|
return PR_FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return PR_TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
PRBool nsRegion::Intersects (const nsRect& aRect) const
|
PRBool nsRegion::Intersects (const nsRect& aRect) const
|
||||||
{
|
{
|
||||||
if (aRect.IsEmpty() || IsEmpty())
|
if (aRect.IsEmpty() || IsEmpty())
|
||||||
|
@ -160,6 +160,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRBool Contains (const nsRect& aRect) const;
|
PRBool Contains (const nsRect& aRect) const;
|
||||||
|
PRBool Contains (const nsRegion& aRgn) const;
|
||||||
PRBool Intersects (const nsRect& aRect) const;
|
PRBool Intersects (const nsRect& aRect) const;
|
||||||
|
|
||||||
void MoveBy (PRInt32 aXOffset, PRInt32 aYOffset)
|
void MoveBy (PRInt32 aXOffset, PRInt32 aYOffset)
|
||||||
@ -400,6 +401,10 @@ public:
|
|||||||
{
|
{
|
||||||
return mImpl.Contains (ToRect (aRect));
|
return mImpl.Contains (ToRect (aRect));
|
||||||
}
|
}
|
||||||
|
PRBool Contains (const nsIntRegion& aRgn) const
|
||||||
|
{
|
||||||
|
return mImpl.Contains (aRgn.mImpl);
|
||||||
|
}
|
||||||
PRBool Intersects (const nsIntRect& aRect) const
|
PRBool Intersects (const nsIntRect& aRect) const
|
||||||
{
|
{
|
||||||
return mImpl.Intersects (ToRect (aRect));
|
return mImpl.Intersects (ToRect (aRect));
|
||||||
|
Loading…
Reference in New Issue
Block a user