Skip to content

Commit

Permalink
Fix tablet mapping when mapped region is specified
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
sifmelcara committed May 23, 2024
1 parent 2ccd45a commit 92907f5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/managers/PointerManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -674,8 +674,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: {
Expand Down

0 comments on commit 92907f5

Please sign in to comment.