mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-07-31 05:30:23 +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 inc2bb777212
by my infinite wisdom >_>. The previous (and thankfully, first) commit in the series is8cab4ab738
.
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user