fix clamp in monitor relative

This commit is contained in:
vaxerski 2023-01-23 20:56:43 +00:00
parent 7574b3db64
commit 70b5c1b119

View file

@ -1709,7 +1709,7 @@ CMonitor* CCompositor::getMonitorFromString(const std::string& name) {
currentPlace = currentPlace % m_vMonitors.size(); currentPlace = currentPlace % m_vMonitors.size();
} }
if (currentPlace != std::clamp(currentPlace, 0, (int)m_vMonitors.size())) { if (currentPlace != std::clamp(currentPlace, 0, (int)m_vMonitors.size() - 1)) {
Debug::log(WARN, "Error in getMonitorFromString: Vaxry's code sucks."); Debug::log(WARN, "Error in getMonitorFromString: Vaxry's code sucks.");
currentPlace = std::clamp(currentPlace, 0, (int)m_vMonitors.size() - 1); currentPlace = std::clamp(currentPlace, 0, (int)m_vMonitors.size() - 1);
} }