mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 23:05:42 +00:00
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:
parent
9f4f847021
commit
bf8a535a29
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user