Revert "Warn when using an AABB or Rect2 with a negative size"

This reverts commit d75e580765.

Fixes #56509.
This commit is contained in:
Rémi Verschelde
2022-01-12 16:04:26 +01:00
parent 1b0ba42ea1
commit 09884f17a3
6 changed files with 6 additions and 140 deletions

View File

@@ -35,11 +35,6 @@ bool Rect2::is_equal_approx(const Rect2 &p_rect) const {
}
bool Rect2::intersects_segment(const Point2 &p_from, const Point2 &p_to, Point2 *r_pos, Point2 *r_normal) const {
#ifdef MATH_CHECKS
if (unlikely(size.x < 0 || size.y < 0)) {
ERR_PRINT("Rect2 size is negative, this is not supported. Use Rect2.abs() to get a Rect2 with a positive size.");
}
#endif
real_t min = 0, max = 1;
int axis = 0;
real_t sign = 0;
@@ -100,11 +95,6 @@ bool Rect2::intersects_segment(const Point2 &p_from, const Point2 &p_to, Point2
}
bool Rect2::intersects_transformed(const Transform2D &p_xform, const Rect2 &p_rect) const {
#ifdef MATH_CHECKS
if (unlikely(size.x < 0 || size.y < 0 || p_rect.size.x < 0 || p_rect.size.y < 0)) {
ERR_PRINT("Rect2 size is negative, this is not supported. Use Rect2.abs() to get a Rect2 with a positive size.");
}
#endif
//SAT intersection between local and transformed rect2
Vector2 xf_points[4] = {