File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
WooCommerce/Classes/POS/Utils Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ enum POSFontStyle {
1414 case posCaptionBold
1515 case posCaptionRegular
1616 case posButtonSymbol
17-
17+
1818 func font( maximumContentSizeCategory: UIContentSizeCategory ? = nil ) -> Font {
1919 switch self {
2020 case . posHeading:
@@ -44,16 +44,16 @@ enum POSFontStyle {
4444 Font . system ( size: scaledValue ( 32 , maximumContentSizeCategory: maximumContentSizeCategory) , weight: . medium)
4545 }
4646 }
47-
47+
4848 private func scaledValue( _ value: CGFloat , maximumContentSizeCategory: UIContentSizeCategory ? ) -> CGFloat {
4949 let metrics = UIFontMetrics . default
5050 let scaledValue = metrics. scaledValue ( for: value)
5151 guard let maximumContentSizeCategory = maximumContentSizeCategory else {
5252 return scaledValue
5353 }
54-
54+
5555 let maximumScaledValue = metrics. scaledValue ( for: value, compatibleWith: . init( preferredContentSizeCategory: maximumContentSizeCategory) )
56-
56+
5757 return min ( scaledValue, maximumScaledValue)
5858 }
5959}
@@ -76,15 +76,15 @@ private struct POSScaledFont: ViewModifier {
7676 @Environment ( \. dynamicTypeSize) var dynamicTypeSize
7777 var style : POSFontStyle
7878 var maximumContentSizeCategory : UIContentSizeCategory ? = nil
79-
79+
8080 func body( content: Content ) -> some View {
8181 content
8282 . font ( style. font ( maximumContentSizeCategory: maximumContentSizeCategory) )
8383 . if ( shouldUnderline ( ) ) { view in
8484 view. underline ( )
8585 }
8686 }
87-
87+
8888 private func shouldUnderline( ) -> Bool {
8989 switch style {
9090 case . posBodyLargeRegular( let underline) ,
You can’t perform that action at this time.
0 commit comments