Skip to content

Commit 28bbaf1

Browse files
committed
stuf
1 parent 579615d commit 28bbaf1

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

hyprtester/src/tests/main/window.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ static bool test() {
161161
const int MONITOR_H = 1080;
162162

163163
const float totalAvailableHeight = MONITOR_H - (GAPSOUT * 2);
164-
const int HEIGHT = std::round(totalAvailableHeight) - BORDERS;
164+
const int HEIGHT = std::floor(totalAvailableHeight) - BORDERS;
165165
const float availableWidthForSplit = MONITOR_W - (GAPSOUT * 2) - GAPSIN;
166166

167167
auto calculateFinalWidth = [&](double boxWidth, bool isLeftWindow) {
168168
double gapLeft = isLeftWindow ? GAPSOUT : GAPSIN;
169169
double gapRight = isLeftWindow ? GAPSIN : GAPSOUT;
170-
return std::round(boxWidth - gapLeft - gapRight - BORDERS);
170+
return std::floor(boxWidth - gapLeft - gapRight - BORDERS);
171171
};
172172

173173
double geomBoxWidthA_R1 = (availableWidthForSplit * INITIAL_RATIO / 2.0) + GAPSOUT + (GAPSIN / 2.0);

src/layout/IHyprLayout.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,16 +500,17 @@ void IHyprLayout::performSnap(Vector2D& sourcePos, Vector2D& sourceSize, PHLWIND
500500
const auto* EXTENTDIFF = *SNAPBORDEROVERLAP ? &EXTENTS : &EXTENTNONE;
501501
const auto MON = DRAGGINGWINDOW->m_monitor.lock();
502502

503-
const auto* GAPSOUT = *SNAPRESPECTGAPS ? sc<CCssGapData*>(PGAPSOUT.ptr()->getData()) : &GAPSNONE;
504-
const auto WORK_AREA = Desktop::CReservedArea{GAPSOUT->m_top, GAPSOUT->m_right, GAPSOUT->m_bottom, GAPSOUT->m_left}.apply(MON->logicalBoxMinusReserved());
503+
const auto* GAPSOUT = *SNAPRESPECTGAPS ? sc<CCssGapData*>(PGAPSOUT.ptr()->getData()) : &GAPSNONE;
504+
const auto RAW_WORK_AREA = MON->logicalBoxMinusReserved();
505+
const auto WORK_AREA = Desktop::CReservedArea{GAPSOUT->m_top, GAPSOUT->m_right, GAPSOUT->m_bottom, GAPSOUT->m_left}.apply(RAW_WORK_AREA);
505506

506507
SRange monX = {WORK_AREA.x, WORK_AREA.x + WORK_AREA.w};
507508
SRange monY = {WORK_AREA.y, WORK_AREA.y + WORK_AREA.h};
508509

509-
const bool HAS_LEFT = WORK_AREA.x != MON->m_position.x;
510-
const bool HAS_TOP = WORK_AREA.y != MON->m_position.y;
511-
const bool HAS_BOTTOM = WORK_AREA.y + WORK_AREA.h != MON->m_position.y + MON->m_size.y;
512-
const bool HAS_RIGHT = WORK_AREA.x + WORK_AREA.w != MON->m_position.x + MON->m_size.y;
510+
const bool HAS_LEFT = RAW_WORK_AREA.x != MON->m_position.x;
511+
const bool HAS_TOP = RAW_WORK_AREA.y != MON->m_position.y;
512+
const bool HAS_BOTTOM = RAW_WORK_AREA.y + RAW_WORK_AREA.h != MON->m_position.y + MON->m_size.y;
513+
const bool HAS_RIGHT = RAW_WORK_AREA.x + RAW_WORK_AREA.w != MON->m_position.x + MON->m_size.y;
513514

514515
if (CORNER & (CORNER_TOPLEFT | CORNER_BOTTOMLEFT) &&
515516
((HAS_LEFT && canSnap(sourceX.start, monX.start, GAPSIZE)) || canSnap(sourceX.start, (monX.start -= MON->m_reservedArea.left() + EXTENTDIFF->topLeft.x), GAPSIZE))) {

src/render/Renderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1834,7 +1834,7 @@ void CHyprRenderer::arrangeLayerArray(PHLMONITOR pMonitor, const std::vector<PHL
18341834
}
18351835

18361836
void CHyprRenderer::arrangeLayersForMonitor(const MONITORID& monitor) {
1837-
const auto PMONITOR = g_pCompositor->getMonitorFromID(monitor);
1837+
const auto PMONITOR = g_pCompositor->getMonitorFromID(monitor);
18381838

18391839
if (!PMONITOR)
18401840
return;

0 commit comments

Comments
 (0)