@momo-kits/native-kits 0.159.1-beta.3 → 0.159.1-beta.4

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.
@@ -1,30 +1,7 @@
1
1
  import SwiftUI
2
2
 
3
3
  public func scaleSize(_ size: CGFloat, _ scaleRate: CGFloat? = nil) -> CGFloat {
4
- let defaultScreenSize: CGFloat = 375
5
- let maxFontScale: CGFloat = scaleRate ?? 1.2
6
- let maxDeviceScale: CGFloat = 5
7
-
8
- let deviceWidth = UIScreen.main.bounds.width
9
- let deviceScale = deviceWidth / defaultScreenSize
10
-
11
- let defaultFont = UIFont.systemFont(ofSize: UIFont.labelFontSize)
12
- let scaledFont = UIFontMetrics.default.scaledFont(for: defaultFont)
13
- let fontScale = scaledFont.pointSize / defaultFont.pointSize
14
-
15
- var fontSizeDeviceScale = size
16
- var fontSizeOSScale = size
17
-
18
-
19
- if deviceScale > 1 {
20
- fontSizeDeviceScale = min(fontSizeDeviceScale * deviceScale, fontSizeDeviceScale + maxDeviceScale)
21
- }
22
-
23
- if fontScale > 1 {
24
- fontSizeOSScale = min(fontSizeOSScale * fontScale, fontSizeOSScale * maxFontScale)
25
- }
26
-
27
- return max(fontSizeDeviceScale, fontSizeOSScale)
4
+ return size
28
5
  }
29
6
 
30
7
  public enum TypographyStyle {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.159.1-beta.3",
3
+ "version": "0.159.1-beta.4",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},