Skip to content

Commit

Permalink
constify vars
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Sep 11, 2023
1 parent d56076d commit 5963150
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/managers/KeybindManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1159,17 +1159,17 @@ void CKeybindManager::moveActiveTo(std::string args) {
return;

if (PLASTWINDOW->m_bIsFloating) {
auto vPos = PLASTWINDOW->m_vRealPosition.goalv();
auto PMONITOR = g_pCompositor->getMonitorFromID(PLASTWINDOW->m_iMonitorID);
int borderSize = PLASTWINDOW->getRealBorderSize();
auto vPos = PLASTWINDOW->m_vRealPosition.goalv();
const auto PMONITOR = g_pCompositor->getMonitorFromID(PLASTWINDOW->m_iMonitorID);
const auto BORDERSIZE = PLASTWINDOW->getRealBorderSize();

switch (arg) {
case 'l': vPos.x = PMONITOR->vecReservedTopLeft.x + borderSize; break;
case 'r': vPos.x = PMONITOR->vecSize.x - PMONITOR->vecReservedBottomRight.x - PLASTWINDOW->m_vRealSize.goalv().x - borderSize; break;
case 'l': vPos.x = PMONITOR->vecReservedTopLeft.x + BORDERSIZE; break;
case 'r': vPos.x = PMONITOR->vecSize.x - PMONITOR->vecReservedBottomRight.x - PLASTWINDOW->m_vRealSize.goalv().x - BORDERSIZE; break;
case 't':
case 'u': vPos.y = PMONITOR->vecReservedTopLeft.y + borderSize; break;
case 'u': vPos.y = PMONITOR->vecReservedTopLeft.y + BORDERSIZE; break;
case 'b':
case 'd': vPos.y = PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y - PLASTWINDOW->m_vRealSize.goalv().y - borderSize; break;
case 'd': vPos.y = PMONITOR->vecSize.y - PMONITOR->vecReservedBottomRight.y - PLASTWINDOW->m_vRealSize.goalv().y - BORDERSIZE; break;
}

PLASTWINDOW->m_vRealPosition = vPos + PMONITOR->vecPosition;
Expand Down

0 comments on commit 5963150

Please sign in to comment.