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`.
This commit is contained in:
Ming-Chuan 2024-05-23 04:52:32 -07:00 committed by GitHub
parent 25b9446949
commit df80fbf706
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -696,8 +696,11 @@ void CPointerManager::warpAbsolute(Vector2D abs, SP<IHID> dev) {
} }
} }
if (!TAB->boundBox.empty()) mappedArea.translate(TAB->boundBox.pos());
mappedArea = TAB->boundBox.translate(currentMonitor->vecPosition); if (!TAB->boundBox.empty()) {
mappedArea.w = TAB->boundBox.w;
mappedArea.h = TAB->boundBox.h;
}
break; break;
} }
case HID_TYPE_TOUCH: { case HID_TYPE_TOUCH: {