Bug 1428348: Allow Set{Left,Right,Top,Bottom}Edge methods to compute negative width/height without asserting. r=bas.schouten

MozReview-Commit-ID: EOGgAvq4lPW

--HG--
extra : rebase_source : 359dc88940a6f9d353b33d6b5a264dc88955157d
This commit is contained in:
Milan Sreckovic 2018-01-09 11:24:37 -05:00
parent 9f4f847021
commit bf8a535a29

View File

@ -442,22 +442,18 @@ struct BaseRect {
// Moves one edge of the rect without moving the opposite edge.
void SetLeftEdge(T aX) {
MOZ_ASSERT(aX <= XMost());
width = XMost() - aX;
x = aX;
}
void SetRightEdge(T aXMost) {
MOZ_ASSERT(aXMost >= x);
width = aXMost - x;
void SetRightEdge(T aXMost) {
width = aXMost - x;
}
void SetTopEdge(T aY) {
MOZ_ASSERT(aY <= YMost());
height = YMost() - aY;
y = aY;
}
void SetBottomEdge(T aYMost) {
MOZ_ASSERT(aYMost >= y);
height = aYMost - y;
void SetBottomEdge(T aYMost) {
height = aYMost - y;
}
void Swap() {
std::swap(x, y);