diff options
| author | Ming-Chuan <10496191+sifmelcara@users.noreply.github.com> | 2024-05-23 04:52:32 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-23 13:52:32 +0200 |
| commit | df80fbf70650dfb0d96381a1d86d30811cf516f4 (patch) | |
| tree | d92eab9ea6ca584eded11376703a88d5299d82a8 /src/managers/PointerManager.cpp | |
| parent | 25b9446949bf12a2bfc1b9a38b4ccac78a06b32d (diff) | |
tablet: fix mapping when mapped region is specified (#6206)
When `region_size` is set in the config (non-empty
`boundBox`), cursor is mapped to wrong coordinate because
`CBox::translate` mutates `TAB->boundBox`, making all subsequent coordinate
calculations wrong.
This also fixes the edge case where user sets `region_position` but
not `region_size`.
Diffstat (limited to 'src/managers/PointerManager.cpp')
| -rw-r--r-- | src/managers/PointerManager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/managers/PointerManager.cpp b/src/managers/PointerManager.cpp index 4be91b80..ae17c6d6 100644 --- a/src/managers/PointerManager.cpp +++ b/src/managers/PointerManager.cpp @@ -696,8 +696,11 @@ void CPointerManager::warpAbsolute(Vector2D abs, SP<IHID> dev) { } } - if (!TAB->boundBox.empty()) - mappedArea = TAB->boundBox.translate(currentMonitor->vecPosition); + mappedArea.translate(TAB->boundBox.pos()); + if (!TAB->boundBox.empty()) { + mappedArea.w = TAB->boundBox.w; + mappedArea.h = TAB->boundBox.h; + } break; } case HID_TYPE_TOUCH: { |
