diff options
author | cutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475> | 2021-02-21 16:37:56 +0000 |
---|---|---|
committer | cutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475> | 2021-02-21 16:37:56 +0000 |
commit | 3a54e8d6b887ffff44388002c6312274a74acebe (patch) | |
tree | 9166e3ad2cd9d29eda373c818e19ee8dbfe5e858 /include/rect.h | |
parent | 1f7c1830cb55c97a398320157853d67796485600 (diff) | |
download | irrlicht-3a54e8d6b887ffff44388002c6312274a74acebe.tar.xz |
Merging r6186 through r6192 from trunk to ogl-es branch
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6193 dfc29bdd-3216-0410-991c-e03cc46cb475
Diffstat (limited to 'include/rect.h')
-rw-r--r-- | include/rect.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/rect.h b/include/rect.h index aeb9cc5..85becf0 100644 --- a/include/rect.h +++ b/include/rect.h @@ -135,16 +135,20 @@ namespace core if (other.LowerRightCorner.Y < LowerRightCorner.Y)
LowerRightCorner.Y = other.LowerRightCorner.Y;
+ if (other.UpperLeftCorner.X > LowerRightCorner.X)
+ LowerRightCorner.X = other.UpperLeftCorner.X;
+ if (other.UpperLeftCorner.Y > LowerRightCorner.Y)
+ LowerRightCorner.Y = other.UpperLeftCorner.Y;
+
+ if (other.LowerRightCorner.X < UpperLeftCorner.X)
+ UpperLeftCorner.X = other.LowerRightCorner.X;
+ if (other.LowerRightCorner.Y < UpperLeftCorner.Y)
+ UpperLeftCorner.Y = other.LowerRightCorner.Y;
+
if (other.UpperLeftCorner.X > UpperLeftCorner.X)
UpperLeftCorner.X = other.UpperLeftCorner.X;
if (other.UpperLeftCorner.Y > UpperLeftCorner.Y)
UpperLeftCorner.Y = other.UpperLeftCorner.Y;
-
- // correct possible invalid rect resulting from clipping
- if (UpperLeftCorner.Y > LowerRightCorner.Y)
- UpperLeftCorner.Y = LowerRightCorner.Y;
- if (UpperLeftCorner.X > LowerRightCorner.X)
- UpperLeftCorner.X = LowerRightCorner.X;
}
//! Moves this rectangle to fit inside another one.
|