Ver Fonte

【fix】【内容编辑】文字字号,自定义输入应该限制成9999,目前是999

tangchao há 7 meses atrás
pai
commit
606a445d56

+ 5 - 2
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/EditPDF/KMEditPDFTextPropertyViewController.swift

@@ -1022,10 +1022,13 @@ extension KMEditPDFTextPropertyViewController: KMSelectPopButtonDelegate {
     
     func km_controlTextDidEndEditing(_ obj: KMDesignSelect) {
         if obj == self.fontSizeVC {
-            let size = CGFloat(Float((obj.stringValue.replacingOccurrences(of: "pt", with: ""))) ?? 1)
+            var string = obj.stringValue.replacingOccurrences(of: "pt", with: "")
+            string = string.replacingOccurrences(of: ",", with: "")
+            
+            let size = Float(string) ?? 1
             let sizeValue = max(size, 1)
             self.fontSizeVC?.stringValue = String(format: "%.0fpt", sizeValue)
-            self.updateFontSize(size: size)
+            self.updateFontSize(size: size.cgFloat)
         }
     }