|
@@ -298,8 +298,8 @@ private enum KMPDFAnnotationFontWeightType: Int {
|
|
|
private func updateAnnotation() {
|
|
|
if annotationModel?.annotation != nil {
|
|
|
for tAnnotation in annotations {
|
|
|
- tAnnotation.updateAppearanceStream()
|
|
|
pdfView?.setNeedsDisplayAnnotationViewFor(tAnnotation.page)
|
|
|
+ tAnnotation.updateAppearanceStream()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -356,14 +356,16 @@ private enum KMPDFAnnotationFontWeightType: Int {
|
|
|
}
|
|
|
|
|
|
@IBAction func fillColorPickerViewAction(_ sender: Any) {
|
|
|
- if annotations.count > 0 {
|
|
|
- for tAnnotation in annotations {
|
|
|
- tAnnotation.backgroundColor = fillColorPickerView.color
|
|
|
+ var color = self.fillColorPickerView.color
|
|
|
+ var r: CGFloat = 0.0, g: CGFloat = 0.0, b: CGFloat = 0.0, a: CGFloat = 0.0
|
|
|
+ if color != nil {
|
|
|
+ color!.usingColorSpace(.deviceRGB)?.getRed(&r, green: &g, blue: &b, alpha: &a)
|
|
|
+ if fabs(a - 0) < 0.001 {
|
|
|
+ color = .clear
|
|
|
}
|
|
|
- } else {
|
|
|
- annotationModel?.setBackgroundColor(fillColorPickerView.color)
|
|
|
- updateAnnotationMode()
|
|
|
}
|
|
|
+ annotationModel?.setBackgroundColor(color)
|
|
|
+ annotationModel?.setBackgroundOpacity(a)
|
|
|
updateAnnotation()
|
|
|
}
|
|
|
|