|
@@ -1008,6 +1008,7 @@ let KMColorPickerViewHeight: CGFloat = 64
|
|
|
textAnnotationImageView.image = annotationModel?.annotationImage
|
|
|
} else {
|
|
|
generalImageView.image = annotationModel?.annotationImage
|
|
|
+ generalImageView.alphaValue = (annotationModel?.opacity())!
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1668,20 +1669,21 @@ let KMColorPickerViewHeight: CGFloat = 64
|
|
|
annotationModel?.setOpacity(opacity)
|
|
|
annotationModel?.setColor(textColor)
|
|
|
} else {
|
|
|
- annotationModel?.setOpacity(opacity)
|
|
|
+ opacity = annotationModel?.opacity() ?? 1
|
|
|
+// annotationModel?.setOpacity(opacity)
|
|
|
annotationModel?.setColor(textColor)
|
|
|
if let model = self.annotationModel {
|
|
|
if (model.annotation == nil || CPDFListViewConfig.defaultManager.isSaveDefault) && self.isannotationMode {
|
|
|
if self.annotationType.isMarkup() {
|
|
|
let type = self.annotationType
|
|
|
if type == .highlight {
|
|
|
- KMPreferenceManager.shared.markupHighlightColor = textColor
|
|
|
+ KMPreferenceManager.shared.markupHighlightColor = textColor.withAlphaComponent(opacity)
|
|
|
} else if type == .underline {
|
|
|
- KMPreferenceManager.shared.markupUnderlineColor = textColor
|
|
|
+ KMPreferenceManager.shared.markupUnderlineColor = textColor.withAlphaComponent(opacity)
|
|
|
} else if type == .strikeOut {
|
|
|
- KMPreferenceManager.shared.markupStrikthroughColor = textColor
|
|
|
+ KMPreferenceManager.shared.markupStrikthroughColor = textColor.withAlphaComponent(opacity)
|
|
|
} else if type == .ink {
|
|
|
- KMPreferenceManager.shared.markupPenColor = textColor
|
|
|
+ KMPreferenceManager.shared.markupPenColor = textColor.withAlphaComponent(opacity)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1802,6 +1804,34 @@ let KMColorPickerViewHeight: CGFloat = 64
|
|
|
}
|
|
|
opacityComboBox.stringValue = "\(Int(opcity * 100))%"
|
|
|
updateAnnotation(.opacity)
|
|
|
+
|
|
|
+ if annotationType == .square || annotationType == .circle || annotationType == .line || annotationType == .arrow {
|
|
|
+
|
|
|
+ } else if annotationType == .freeText {
|
|
|
+
|
|
|
+ } else if annotationType == .signDate || annotationType == .signText {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ var opacity = annotationModel?.opacity() ?? 1
|
|
|
+ var textColor = annotationModel?.color() ?? NSColor.clear
|
|
|
+ annotationModel?.setColor(textColor)
|
|
|
+ if let model = self.annotationModel {
|
|
|
+ if (model.annotation == nil || CPDFListViewConfig.defaultManager.isSaveDefault) && self.isannotationMode {
|
|
|
+ if self.annotationType.isMarkup() {
|
|
|
+ let type = self.annotationType
|
|
|
+ if type == .highlight {
|
|
|
+ KMPreferenceManager.shared.markupHighlightColor = textColor.withAlphaComponent(opacity)
|
|
|
+ } else if type == .underline {
|
|
|
+ KMPreferenceManager.shared.markupUnderlineColor = textColor.withAlphaComponent(opacity)
|
|
|
+ } else if type == .strikeOut {
|
|
|
+ KMPreferenceManager.shared.markupStrikthroughColor = textColor.withAlphaComponent(opacity)
|
|
|
+ } else if type == .ink {
|
|
|
+ KMPreferenceManager.shared.markupPenColor = textColor.withAlphaComponent(opacity)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@IBAction func opacityComboBoxAction(_ sender: Any) {
|