@hkdigital/lib-core 0.5.32 → 0.5.33
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);
|