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 = 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: {