@aks-dev/easyui 1.0.109 → 1.0.111

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/screen/px2sp.ts +11 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aks-dev/easyui",
3
- "version": "1.0.109",
3
+ "version": "1.0.111",
4
4
  "description": "工具箱",
5
5
  "main": "./src/index.ts",
6
6
  "typings": "./src/index.d.ts",
package/screen/px2sp.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * @Author: shiguo
3
3
  * @Date: 2021-04-27 10:40:36
4
4
  * @LastEditors: shiguo
5
- * @LastEditTime: 2022-07-18 11:27:22
5
+ * @LastEditTime: 2022-10-28 17:14:14
6
6
  * @FilePath: /@aks-dev/easyui/screen/px2sp.ts
7
7
  */
8
8
  import { Dimensions, PixelRatio } from 'react-native';
@@ -11,6 +11,13 @@ const width = Dimensions.get('window').width; //设备的宽度
11
11
  const height = Dimensions.get('window').height; //设备的高度
12
12
 
13
13
  export const px2sp = (size: number) => {
14
+
15
+ // console.log({
16
+ // pixelRatio,
17
+ // width,
18
+ // height
19
+ // })
20
+
14
21
  if (pixelRatio === 2) {
15
22
  // iphone 5s and older Androids
16
23
  if (width < 360) {
@@ -53,16 +60,16 @@ export const px2sp = (size: number) => {
53
60
  // Catch other smaller android height sizings
54
61
  }
55
62
  if (height < 667) {
56
- return size * 1.2;
63
+ return size * 1.15;//older:1.20
57
64
  // catch in-between size Androids and scale font up
58
65
  // a tad but not too much
59
66
  }
60
67
  if (height >= 667 && height <= 735) {
61
- return size * 1.25;
68
+ return size * 1.20;//older:1.25
62
69
  }
63
70
  // catch larger phablet devices
64
71
 
65
- return size * 1.3;
72
+ return size * 1.25;//older:1.30
66
73
  }
67
74
  // if older device ie pixelRatio !== 2 || 3 || 3.5
68
75
  return size;