()
| 122 | } |
| 123 | |
| 124 | function getTouchScreen(): TouchScreen { |
| 125 | // Normalize the screen by any scaling to get the layout coordinate space. |
| 126 | let screenWidth = Number(window.visualViewport?.width ?? window.innerWidth); |
| 127 | let screenHeight = Number(window.visualViewport?.height ?? window.innerHeight); |
| 128 | let visualScale = Number(window.visualViewport?.scale ?? 1); |
| 129 | |
| 130 | return { |
| 131 | width: screenWidth * visualScale, |
| 132 | height: screenHeight * visualScale, |
| 133 | angle: window.screen.orientation?.angle ?? 0 |
| 134 | }; |
| 135 | } |
| 136 | |
| 137 | function onResizeStart(e: Event): void { |
| 138 | // So we don't constantly call clearTimeout and setTimeout, keep track of the |
no outgoing calls
no test coverage detected