Add touch-to-logical coordinate mapping for UI
Implements tapToLogical() to convert normalized touch coordinates to orientation-aware logical screen coordinates. Adds TouchRegistry hit testing for interactive UI elements and header back button. Touch gestures now work correctly across all screen orientations (Portrait, Landscape, etc.) by inverting the rotateCoordinates transform.
This commit is contained in:
@@ -16,6 +16,9 @@ struct Rect {
|
||||
int height;
|
||||
|
||||
explicit Rect(int x = 0, int y = 0, int width = 0, int height = 0) : x(x), y(y), width(width), height(height) {}
|
||||
|
||||
// Logical-coordinate point hit-test (used for touch target hit-testing).
|
||||
bool contains(int px, int py) const { return px >= x && px < x + width && py >= y && py < y + height; }
|
||||
};
|
||||
|
||||
struct TabInfo {
|
||||
|
||||
Reference in New Issue
Block a user