()
| 1172 | |
| 1173 | // Account for window resize and custom scale changes. |
| 1174 | function handleResize() { |
| 1175 | const w = window.innerWidth; |
| 1176 | const h = window.innerHeight; |
| 1177 | // Try to adopt screen size, heeding maximum sizes specified |
| 1178 | const containerW = Math.min(w, MAX_WIDTH); |
| 1179 | // On small screens, use full device height |
| 1180 | const containerH = w <= 420 ? h : Math.min(h, MAX_HEIGHT); |
| 1181 | appNodes.stageContainer.style.width = containerW + "px"; |
| 1182 | appNodes.stageContainer.style.height = containerH + "px"; |
| 1183 | stages.forEach((stage) => stage.resize(containerW, containerH)); |
| 1184 | // Account for scale |
| 1185 | const scaleFactor = scaleFactorSelector(); |
| 1186 | stageW = containerW / scaleFactor; |
| 1187 | stageH = containerH / scaleFactor; |
| 1188 | } |
| 1189 | |
| 1190 | // Compute initial dimensions |
| 1191 | handleResize(); |
no test coverage detected