mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-04-22 15:41:57 +02:00
Fix Rect::operator & (intersection)
Completely neglected to normalize the Rect's size. Somehow completely asymptomatic unless looking at the favourites menu if it's too long to fit on the screen, on MacOS. Yeah. Another in the series of fixes for easily avoidable problems introduced in c2bb77721208 by my infinite wisdom >_>. The previous (and thankfully, first) commit in the series is 8cab4ab73819.
This commit is contained in:
parent
a32f0fe178
commit
6dd0e9533f
@ -367,7 +367,8 @@ public:
|
||||
{
|
||||
auto tl = Vec2<T>(std::max(pos.X , other.pos.X ), std::max(pos.Y , other.pos.Y ));
|
||||
auto br1 = Vec2<T>(std::min(pos.X + size.X, other.pos.X + other.size.X), std::min(pos.Y + size.Y, other.pos.Y + other.size.Y));
|
||||
return Rect<T>(tl, br1 - tl);
|
||||
auto size = br1 - tl;
|
||||
return Rect<T>(tl, Vec2<T>(std::max(size.X, T(0)), std::max(size.Y, T(0))));
|
||||
}
|
||||
|
||||
inline Rect<T> &operator&=(Rect<T> other)
|
||||
|
Loading…
x
Reference in New Issue
Block a user