@hkdigital/lib-core 0.5.32 → 0.5.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -189,36 +189,40 @@
|
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
if( aspectOnLandscape )
|
|
202
|
-
{
|
|
203
|
-
gameHeightOnLandscape = gameWidthOnLandscape / aspectOnLandscape;
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
gameHeightOnLandscape = availHeight;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
gameWidthOnPortrait = getGameWidthOnPortrait({
|
|
210
|
-
windowWidth: availWidth,
|
|
211
|
-
windowHeight: availHeight,
|
|
212
|
-
aspectOnPortrait
|
|
213
|
-
});
|
|
192
|
+
if (availWidth > availHeight) {
|
|
193
|
+
// Calculate game dimensions for both orientations
|
|
194
|
+
// Orientation is determined by matchMedia/screen.orientation.angle,
|
|
195
|
+
// not by dimension comparison
|
|
196
|
+
gameWidthOnLandscape = getGameWidthOnLandscape({
|
|
197
|
+
windowWidth: availWidth,
|
|
198
|
+
windowHeight: availHeight,
|
|
199
|
+
aspectOnLandscape
|
|
200
|
+
});
|
|
214
201
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
202
|
+
if( aspectOnLandscape )
|
|
203
|
+
{
|
|
204
|
+
gameHeightOnLandscape = gameWidthOnLandscape / aspectOnLandscape;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
gameHeightOnLandscape = availHeight;
|
|
208
|
+
}
|
|
218
209
|
}
|
|
219
210
|
else {
|
|
220
|
-
|
|
211
|
+
gameWidthOnPortrait = getGameWidthOnPortrait({
|
|
212
|
+
windowWidth: availWidth,
|
|
213
|
+
windowHeight: availHeight,
|
|
214
|
+
aspectOnPortrait
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
if( aspectOnPortrait )
|
|
218
|
+
{
|
|
219
|
+
gameHeightOnPortrait = gameWidthOnPortrait / aspectOnPortrait;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
gameHeightOnPortrait = availHeight;
|
|
223
|
+
}
|
|
221
224
|
}
|
|
225
|
+
|
|
222
226
|
});
|
|
223
227
|
|
|
224
228
|
let show = $state(false);
|
|
@@ -244,13 +248,16 @@
|
|
|
244
248
|
|
|
245
249
|
// Use window.inner dimensions instead of screen dimensions
|
|
246
250
|
// because screen.width/height don't rotate on iOS PWA
|
|
247
|
-
if (angle === 90 || angle === 270) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
} else {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
251
|
+
// if (angle === 90 || angle === 270) {
|
|
252
|
+
// iosWindowWidth = window.innerHeight;
|
|
253
|
+
// iosWindowHeight = window.innerWidth;
|
|
254
|
+
// } else {
|
|
255
|
+
// iosWindowWidth = window.innerWidth;
|
|
256
|
+
// iosWindowHeight = window.innerHeight;
|
|
257
|
+
// }
|
|
258
|
+
|
|
259
|
+
iosWindowWidth = window.innerWidth;
|
|
260
|
+
iosWindowHeight = window.innerHeight;
|
|
254
261
|
|
|
255
262
|
if( debug )
|
|
256
263
|
{
|