mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-10 09:45:58 +01:00
Scale border size in calculations of windows
This commit is contained in:
parent
fad5fc587d
commit
c885afcbc6
1 changed files with 8 additions and 6 deletions
|
@ -241,12 +241,14 @@ void CHyprMasterLayout::applyNodeDataToWindow(SMasterNodeData* pNode) {
|
||||||
PWINDOW->m_vSize = pNode->size;
|
PWINDOW->m_vSize = pNode->size;
|
||||||
PWINDOW->m_vPosition = pNode->position;
|
PWINDOW->m_vPosition = pNode->position;
|
||||||
|
|
||||||
auto calcPos = PWINDOW->m_vPosition + Vector2D(*PBORDERSIZE, *PBORDERSIZE);
|
float scaledBorderSize = *PBORDERSIZE / PMONITOR->scale;
|
||||||
auto calcSize = PWINDOW->m_vSize - Vector2D(2 * *PBORDERSIZE, 2 * *PBORDERSIZE);
|
|
||||||
|
auto calcPos = PWINDOW->m_vPosition + Vector2D(scaledBorderSize, scaledBorderSize);
|
||||||
|
auto calcSize = PWINDOW->m_vSize - Vector2D(2 * scaledBorderSize, 2 * scaledBorderSize);
|
||||||
|
|
||||||
if (*PNOGAPSWHENONLY && PWINDOW->m_iWorkspaceID != SPECIAL_WORKSPACE_ID && getNodesOnWorkspace(PWINDOW->m_iWorkspaceID) == 1) {
|
if (*PNOGAPSWHENONLY && PWINDOW->m_iWorkspaceID != SPECIAL_WORKSPACE_ID && getNodesOnWorkspace(PWINDOW->m_iWorkspaceID) == 1) {
|
||||||
PWINDOW->m_vRealPosition = calcPos - Vector2D(*PBORDERSIZE, *PBORDERSIZE);
|
PWINDOW->m_vRealPosition = calcPos - Vector2D(scaledBorderSize, scaledBorderSize);
|
||||||
PWINDOW->m_vRealSize = calcSize + Vector2D(2 * *PBORDERSIZE, 2 * *PBORDERSIZE);
|
PWINDOW->m_vRealSize = calcSize + Vector2D(2 * scaledBorderSize, 2 * scaledBorderSize);
|
||||||
|
|
||||||
PWINDOW->updateWindowDecos();
|
PWINDOW->updateWindowDecos();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue