We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4bba92 commit 753883fCopy full SHA for 753883f
applications/libwindow/inc/libwindow/metrics/rectangle.hpp
@@ -186,15 +186,12 @@ struct g_rectangle
186
return;
187
}
188
189
- int newX = std::min(x, p.x);
190
- int newY = std::min(y, p.y);
191
- int newWidth = std::max(x + width, p.x + 1) - newX;
192
- int newHeight = std::max(y + height, p.y + 1) - newY;
193
-
194
- x = newX;
195
- y = newY;
196
- width = newWidth;
197
- height = newHeight;
+ int right = std::max(x + width, p.x + 1);
+ int bottom = std::max(y + height, p.y + 1);
+ x = std::min(x, p.x);
+ y = std::min(y, p.y);
+ width = right - x;
+ height = bottom - y;
198
199
200
/**
0 commit comments