Fix back gesture to use logical screen coordinates

Changed the fallback corner gesture detection to use logical (orientation-mapped) coordinates instead of native panel coordinates. This ensures the gesture area remains in the visual top-left corner across all screen orientations, particularly for screens without a header or Back button target like the reader.
This commit is contained in:
Justin Mitchell
2026-06-15 16:28:23 -04:00
parent f1b5da25b0
commit 8ad538c98b
+5 -2
View File
@@ -70,8 +70,11 @@ bool MappedInputManager::wasBackGesture() const {
renderer.tapToLogical(nx, ny, lx, ly);
int id = 0;
if (TouchRegistry::getInstance().hitTest(lx, ly, TouchRegistry::Back, id)) return true;
// Fallback corner gesture (panel-native, generous; works even with no Back target).
return nx <= BACK_GESTURE_FRAC_X && ny <= BACK_GESTURE_FRAC_Y;
// Fallback corner gesture: top-left of the LOGICAL screen (orientation-mapped), so
// it lands on the visual top-left in every orientation and works on screens with no
// header/Back target (e.g. the reader).
return lx <= renderer.getScreenWidth() * BACK_GESTURE_FRAC_X &&
ly <= renderer.getScreenHeight() * BACK_GESTURE_FRAC_Y;
}
bool MappedInputManager::wasItemTapped(int& id) const {