mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 681192. Part 0.1: Add BaseRect::ClampPoint. r=bas
--HG-- extra : rebase_source : 32e086725d450d8867a4b5978cd76a2f03609572
This commit is contained in:
parent
528e055ee2
commit
2ec4edf80b
@ -415,6 +415,16 @@ struct BaseRect {
|
|||||||
height = bottom - y;
|
height = bottom - y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clamp aPoint to this rectangle. It is allowed to end up on any
|
||||||
|
* edge of the rectangle.
|
||||||
|
*/
|
||||||
|
Point ClampPoint(const Point& aPoint) const
|
||||||
|
{
|
||||||
|
return Point(NS_MAX(x, NS_MIN(XMost(), aPoint.x)),
|
||||||
|
NS_MAX(y, NS_MIN(YMost(), aPoint.y)));
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Do not use the default operator== or operator!= !
|
// Do not use the default operator== or operator!= !
|
||||||
// Use IsEqualEdges or IsEqualInterior explicitly.
|
// Use IsEqualEdges or IsEqualInterior explicitly.
|
||||||
|
Loading…
Reference in New Issue
Block a user