|
@@ -353,6 +353,7 @@ let KMColorPickerViewHeight: CGFloat = 64
|
|
|
alignmentTypeSelected(alignmentType)
|
|
|
}
|
|
|
|
|
|
+ fillColorPickerView.isCallColorPanelAction = isannotationMode
|
|
|
textColorPickerView.isCallColorPanelAction = isannotationMode
|
|
|
borderColorPickerView.isCallColorPanelAction = isannotationMode
|
|
|
|
|
@@ -978,8 +979,8 @@ let KMColorPickerViewHeight: CGFloat = 64
|
|
|
if annotation is CPDFFreeTextAnnotation {
|
|
|
let textNote = (annotation as! CPDFFreeTextAnnotation)
|
|
|
if let isEdit = pdfView?.isEdit(withCurrentFreeText: textNote), isEdit {
|
|
|
-// pdfView?.commitEditAnnotationFreeText(textNote)
|
|
|
- pdfView?.editAnnotationFreeText(textNote)
|
|
|
+ pdfView?.commitEditAnnotationFreeText(textNote)
|
|
|
+// pdfView?.editAnnotationFreeText(textNote)
|
|
|
}
|
|
|
|
|
|
pdfView?.setNeedsDisplay(pdfView?.activeAnnotation)
|
|
@@ -1717,21 +1718,26 @@ let KMColorPickerViewHeight: CGFloat = 64
|
|
|
var fillColor = NSColor.clear
|
|
|
var red: CGFloat = 0.0, green: CGFloat = 0.0, blue: CGFloat = 0.0, opacity: CGFloat = 0.0
|
|
|
|
|
|
+ if let fillColorPickerColor = fillColorPickerView.color {
|
|
|
+ annotationModel?.setColor(fillColorPickerColor)
|
|
|
+// annotationModel?.setOpacity(opacity)
|
|
|
+ }
|
|
|
+ updateAnnotation(.color)
|
|
|
+ }
|
|
|
+
|
|
|
+ @IBAction func borderColorPickerViewAction(_ sender: Any) {
|
|
|
+ var fillColor = NSColor.clear
|
|
|
+ var red: CGFloat = 0.0, green: CGFloat = 0.0, blue: CGFloat = 0.0, opacity: CGFloat = 0.0
|
|
|
+
|
|
|
if let borderColor = borderColorPickerView.color {
|
|
|
borderColor.usingColorSpaceName(.calibratedRGB)?.getRed(&red, green: &green, blue: &blue, alpha: &opacity)
|
|
|
let color = NSColor(calibratedRed: red, green: green, blue: blue, alpha: opacity)
|
|
|
fillColor = color
|
|
|
}
|
|
|
|
|
|
- if annotationType == .freeText {
|
|
|
- if let fillColorPickerColor = fillColorPickerView.color {
|
|
|
- annotationModel?.setColor(fillColorPickerColor)
|
|
|
-// annotationModel?.setOpacity(opacity)
|
|
|
- }
|
|
|
- } else {
|
|
|
- annotationModel?.setColor(fillColor)
|
|
|
- annotationModel?.setOpacity(opacity)
|
|
|
- }
|
|
|
+ annotationModel?.setColor(fillColor)
|
|
|
+ annotationModel?.setOpacity(opacity)
|
|
|
+
|
|
|
updateAnnotation(.color)
|
|
|
}
|
|
|
|