commit 01546f5cdc4678a4e69043610b1a0524ffff6e5d
parent 0576f4c342cac4de112556a4593d3dbe7c9751b3
Author: Cristina Horotan <chorotan@mozilla.com>
Date: Sat, 4 Oct 2025 03:05:14 +0300
Revert "Bug 1992305 - Use std::numeric_limits::lowest() rather than std::numeric_limits::min(). r=gfx-reviewers,nical" for causing build bustage at TestRect.cpp
This reverts commit c2cf93cc4884e7b777f073a0a44465c16891ba3f.
Diffstat:
2 files changed, 2 insertions(+), 25 deletions(-)
diff --git a/gfx/2d/BaseRect.h b/gfx/2d/BaseRect.h
@@ -329,7 +329,7 @@ struct BaseRect {
x = limit - aDx < x ? limit : x + aDx;
width = (limit - aDx < x2 ? limit : x2 + aDx) - x;
} else {
- T limit = std::numeric_limits<T>::lowest();
+ T limit = std::numeric_limits<T>::min();
x = limit - aDx > x ? limit : x + aDx;
width = (limit - aDx > x2 ? limit : x2 + aDx) - x;
}
@@ -341,7 +341,7 @@ struct BaseRect {
y = limit - aDy < y ? limit : y + aDy;
height = (limit - aDy < y2 ? limit : y2 + aDy) - y;
} else {
- T limit = std::numeric_limits<T>::lowest();
+ T limit = std::numeric_limits<T>::min();
y = limit - aDy > y ? limit : y + aDy;
height = (limit - aDy > y2 ? limit : y2 + aDy) - y;
}
diff --git a/gfx/tests/gtest/TestRect.cpp b/gfx/tests/gtest/TestRect.cpp
@@ -711,26 +711,3 @@ TEST(Gfx, ClampPoint)
EXPECT_EQ(Empty.ClampPoint(IntPoint(1, -1)), IntPoint(0, 0));
EXPECT_EQ(Empty.ClampPoint(IntPoint(1, 1)), IntPoint(0, 0));
}
-
-TEST(Gfx, SafeMoveBy)
-{
- IntRect intRect(0, 0, 10, 10);
- intRect.SafeMoveByX(10);
- intRect.SafeMoveByY(10);
- EXPECT_EQ(intRect, IntRect(10, 10, 10, 10));
-
- intRect = IntRect(0, 0, 10, 10);
- intRect.SafeMoveByX(-10);
- intRect.SafeMoveByY(-10);
- EXPECT_EQ(intRect, IntRect(-10, -10, 10, 10));
-
- Rect rect(0, 0, 10, 10);
- rect.SafeMoveByX(10);
- rect.SafeMoveByY(10);
- EXPECT_EQ(rect, Rect(10, 10, 10, 10));
-
- rect = Rect(0, 0, 10, 10);
- rect.SafeMoveByX(-10);
- rect.SafeMoveByY(-10);
- EXPECT_EQ(rect, Rect(-10, -10, 10, 10));
-}