UI: Use rect intersection test for validating position

Instead of checking to see if the window's position is valid, check to
see if the rectangles of the window and the monitor intersect via a
rectangle intersection test.
This commit is contained in:
jp9000 committed 2016-09-28 22:26:28 -07:00
1 parent a8020b37be
commit 48f0c73f82
3 files changed
+9 -9

No files matched your search

+1 -3
View File
@@ -137,9 +137,7 @@ OBSBasic::OBSBasic(QWidget *parent)
restoreGeometry(byteArray);
QRect windowGeometry = normalGeometry();
int posx = windowGeometry.x();
int posy = windowGeometry.y();
if (!WindowPositionValid(posx, posy)) {
if (!WindowPositionValid(windowGeometry)) {
QRect rect = App()->desktop()->availableGeometry();
setGeometry(QStyle::alignedRect(
Qt::LeftToRight,