@momo-kits/foundation 0.167.1 → 0.167.2-beta.1
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/Text/utils.ts +1 -1
- package/package.json +1 -1
package/Text/utils.ts
CHANGED
|
@@ -8,12 +8,12 @@ const MAX_FONT_SCALE = 1.5;
|
|
|
8
8
|
const MAX_DEVICE_SCALE = 5;
|
|
9
9
|
|
|
10
10
|
const useScaleSize = (size: number, scaleRate?: number) => {
|
|
11
|
+
const { width } = useWindowDimensions();
|
|
11
12
|
const context = useContext<any>(MiniAppContext);
|
|
12
13
|
if (context?.fontScale?.useOSScaleRate === false) {
|
|
13
14
|
return size * (context.fontScale.userScaleRate ?? 1);
|
|
14
15
|
}
|
|
15
16
|
const fontScale = PixelRatio.getFontScale();
|
|
16
|
-
const { width } = useWindowDimensions();
|
|
17
17
|
const deviceScale = width / DEFAULT_SCREEN_SIZE;
|
|
18
18
|
|
|
19
19
|
const maxScaleRate = scaleRate ?? MAX_FONT_SCALE;
|