summaryrefslogtreecommitdiff
path: root/src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp
diff options
context:
space:
mode:
authorfvla <fvla@users.noreply.github.com>2026-03-26 17:38:56 -0400
committerGitHub <noreply@github.com>2026-03-26 21:38:56 +0000
commit2fde538e0fa5663ac99f631fcfee6742e09368f6 (patch)
tree148017bdc0364f6557219c5f3d059d9ad823ac29 /src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp
parentb0f6ac23b26e62f650d3b26dfb0aa7eb15e29da8 (diff)
algo/scrolling: improve behavior with focus_fit_method = center (#13795)
Diffstat (limited to 'src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp')
-rw-r--r--src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp b/src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp
index 6cd7da9c..657b6542 100644
--- a/src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp
+++ b/src/layout/algorithm/tiled/scrolling/ScrollTapeController.cpp
@@ -1,5 +1,6 @@
#include "ScrollTapeController.hpp"
#include "ScrollingAlgorithm.hpp"
+#include "../../../../config/ConfigValue.hpp"
#include <algorithm>
#include <cmath>
@@ -205,8 +206,9 @@ double CScrollTapeController::calculateCameraOffset(const CBox& usableArea, bool
if (maxExtent < usablePrimary)
m_offset = std::round((maxExtent - usablePrimary) / 2.0);
- // if the offset is negative but we already extended, reset offset to 0
- if (maxExtent > usablePrimary && m_offset < 0.0)
+ // if the offset is negative but we already extended and fit method is not center, reset offset to 0
+ static const auto PFITMETHOD = CConfigValue<Hyprlang::INT>("scrolling:focus_fit_method");
+ if (maxExtent > usablePrimary && m_offset < 0.0 && *PFITMETHOD != 0)
m_offset = 0.0;
return m_offset;