Forráskód Böngészése

Merge branch 'master' of https://git.yishihui.com/iOS/BFRecordScreenKit

wenweiwei 3 éve
szülő
commit
f2c6db5d7f

+ 3 - 3
BFRecordScreenKit/Classes/RecordScreen/Controller/BFRecordScreenController.swift

@@ -794,13 +794,13 @@ public class BFRecordScreenController: BFBaseViewController {
         if settingModel.subtitleIsShow {
             // 设置样式
             subtitleLabel.strokeColor = settingModel.strokeColor
-            subtitleLabel.strokeWidth = settingModel.strokeWidth * 375 / 1080
-            subtitleLabel.font = UIFont.boldSystemFont(ofSize: CGFloat(settingModel.subtitleSize) * 375 / 1080)
+            subtitleLabel.strokeWidth = settingModel.strokeWidth * cScreenWidth / 1080
+            subtitleLabel.font = UIFont.boldSystemFont(ofSize: CGFloat(settingModel.subtitleSize) * cScreenWidth / 1080)
             subtitleLabel.textColor = settingModel.fontColor
 
             let leftPoint: CGFloat = 37
 
-            let height = sizeTextFits(attributedText: nil, text: subtitleLabel.text ?? "", numberOfLines: 0, font: subtitleLabel.font, maxSize: CGSize(width: cScreenWidth - leftPoint * 2, height: CGFloat.greatestFiniteMagnitude)).height
+            let height = sizeTextFits(attributedText: nil, text: subtitleLabel.text ?? "", numberOfLines: 0, font: subtitleLabel.font, maxSize: CGSize(width: cScreenWidth * 0.75, height: CGFloat.greatestFiniteMagnitude)).height
 
             subtitleLabel.backgroundColor = subtitleSettingView.subtitle.setting.backgroundColor
             // 下 //设置位置

+ 8 - 7
BFRecordScreenKit/Classes/RecordScreen/View/BFSubtitleSettingView.swift

@@ -58,13 +58,13 @@ class BFSubtitleSettingView: UIView {
         
         
 
-        styleConfig = [0: ["fontColor": UIColor.hexColor(hexadecimal: "#FFFFFF"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":3.7,"subtitleSize":40],
-                       1: ["fontColor": UIColor.hexColor(hexadecimal: "#FF9292"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":4.3,"subtitleSize":49],
-                       2: ["fontColor": UIColor.hexColor(hexadecimal: "#80C2FF"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":5.2,"subtitleSize":60],
-                       3: ["fontColor": UIColor.hexColor(hexadecimal: "#80E4AB"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":5.8,"subtitleSize":69],
-                       4: ["fontColor": UIColor.hexColor(hexadecimal: "#FFCF53"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":7.2,"subtitleSize":81],
-                       5: ["fontColor": UIColor.hexColor(hexadecimal: "#000000"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.white, "backgroundAlpha": 0.0,"strokeWidth":8.7,"subtitleSize":101],
-                       6: ["fontColor": UIColor.hexColor(hexadecimal: "#FFFFFF"), "backgroundColor":UIColor.init(red: 0, green: 0, blue: 0, alpha: 0.6), "strokeColor": UIColor.clear, "backgroundAlpha": 0.6,"strokeWidth":10.1,"subtitleSize":121]]
+        styleConfig = [0: ["fontColor": UIColor.hexColor(hexadecimal: "#FFFFFF"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":7.4,"subtitleSize":40],
+                       1: ["fontColor": UIColor.hexColor(hexadecimal: "#FF9292"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":8.6,"subtitleSize":49],
+                       2: ["fontColor": UIColor.hexColor(hexadecimal: "#80C2FF"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":10.4,"subtitleSize":60],
+                       3: ["fontColor": UIColor.hexColor(hexadecimal: "#80E4AB"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":11.6,"subtitleSize":69],
+                       4: ["fontColor": UIColor.hexColor(hexadecimal: "#FFCF53"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.black, "backgroundAlpha": 0.0,"strokeWidth":14.4,"subtitleSize":81],
+                       5: ["fontColor": UIColor.hexColor(hexadecimal: "#000000"), "backgroundColor": UIColor.clear, "strokeColor": UIColor.white, "backgroundAlpha": 0.0,"strokeWidth":17.4,"subtitleSize":101],
+                       6: ["fontColor": UIColor.hexColor(hexadecimal: "#FFFFFF"), "backgroundColor":UIColor.init(red: 0, green: 0, blue: 0, alpha: 0.6), "strokeColor": UIColor.clear, "backgroundAlpha": 0.6,"strokeWidth":20.2,"subtitleSize":121]]
 
         // 字体样式
         for i in 0...6 {
@@ -290,6 +290,7 @@ class BFSubtitleSettingView: UIView {
         
         let config = styleConfig[wordSizeIndex]
         subtitle.setting.subtitleSize = config?["subtitleSize"] as! Int
+        subtitle.setting.strokeWidth = CGFloat(config?["strokeWidth"] as? Double ?? 0.0)
         if subtitleSettingCallBack != nil {
             subtitleSettingCallBack!(subtitle)
         }