Prevent a crash in the SGCT Editor when trying to add more than 2 windows on a computer with only 1 monitor

This commit is contained in:
Alexander Bock
2023-01-12 17:04:49 +01:00
parent fac1183fd7
commit 1e4ab517d8

View File

@@ -49,7 +49,8 @@ void DisplayWindowUnion::createWidgets(int nMaxWindows,
{
// Add all window controls (some will be hidden from GUI initially)
for (int i = 0; i < nMaxWindows; ++i) {
const int monitorNumForThisWindow = (nMaxWindows > 3 && i >= 2) ? 1 : 0;
const int monitorNumForThisWindow =
(monitorResolutions.size() > 1 && i >= 2) ? 1 : 0;
WindowControl* ctrl = new WindowControl(
monitorNumForThisWindow,