@dcl/react-ecs 7.24.3-28263300619.commit-182d37c → 7.24.3
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.
- package/dist/system.js +5 -2
- package/package.json +3 -3
package/dist/system.js
CHANGED
|
@@ -70,11 +70,14 @@ export function createReactBasedUiSystem(engine, pointerSystem) {
|
|
|
70
70
|
}
|
|
71
71
|
if (!canvasInfo)
|
|
72
72
|
return;
|
|
73
|
-
const { width, height } = canvasInfo;
|
|
73
|
+
const { width, height, devicePixelRatio } = canvasInfo;
|
|
74
74
|
const { virtualWidth, virtualHeight } = activeVirtualSize;
|
|
75
75
|
if (!virtualWidth || !virtualHeight)
|
|
76
76
|
return;
|
|
77
|
-
|
|
77
|
+
// Normalize by devicePixelRatio so virtual px map to logical px (matching the
|
|
78
|
+
// vw/vh path); without it the scale was inflated on high-dpr mobile screens.
|
|
79
|
+
const ratio = devicePixelRatio || 1;
|
|
80
|
+
const nextScale = Math.min(width / virtualWidth, height / virtualHeight) / ratio;
|
|
78
81
|
if (Number.isFinite(nextScale) && nextScale !== getUiScaleFactor()) {
|
|
79
82
|
// Track ownership when updating to avoid cross-system conflicts.
|
|
80
83
|
setUiScaleFactor(nextScale, uiScaleFactorOwner);
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/react-ecs",
|
|
3
3
|
"description": "Decentraland ECS",
|
|
4
|
-
"version": "7.24.3
|
|
4
|
+
"version": "7.24.3",
|
|
5
5
|
"author": "DCL",
|
|
6
6
|
"bugs": "https://github.com/decentraland/js-sdk-toolchain/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@dcl/ecs": "7.24.3
|
|
8
|
+
"@dcl/ecs": "7.24.3",
|
|
9
9
|
"react": "^18.2.0",
|
|
10
10
|
"react-reconciler": "^0.29.0"
|
|
11
11
|
},
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"tsconfig": "./tsconfig.json"
|
|
41
41
|
},
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
43
|
-
"commit": "
|
|
43
|
+
"commit": "3df0a22399b70665da37e40712b3eb22d5f7a193"
|
|
44
44
|
}
|