|
@@ -131,7 +131,7 @@ class KMHighlightController: NSViewController {
|
|
|
}
|
|
|
|
|
|
if annotations.count == 0 {
|
|
|
-
|
|
|
+
|
|
|
var curColor: NSColor = NSColor.clear
|
|
|
var opacity: CGFloat = 0
|
|
|
|
|
@@ -151,7 +151,7 @@ class KMHighlightController: NSViewController {
|
|
|
|
|
|
colorGroup.currentColor = curColor
|
|
|
colorGroup.refreshUI()
|
|
|
-
|
|
|
+
|
|
|
colorSlider.properties.percent = opacity
|
|
|
colorSlider.reloadData()
|
|
|
|
|
@@ -196,7 +196,7 @@ class KMHighlightController: NSViewController {
|
|
|
}
|
|
|
|
|
|
func updateDefaultInfo(_ color: NSColor?, _ opacity: CGFloat?) {
|
|
|
- if let resultColor = color {
|
|
|
+ if let resultColor = color {
|
|
|
if annotations.count == 0 {
|
|
|
if viewManager?.subToolMode == .Highlight {
|
|
|
CPDFAnnotationConfig.standard.setColor(resultColor, toType: .highlight)
|
|
@@ -212,8 +212,8 @@ class KMHighlightController: NSViewController {
|
|
|
CPDFAnnotationConfig.standard.setColor(resultColor, toType: annotation.exchangeToAnnotationType(annotation.markupType()))
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- NotificationCenter.default.post(name: toolbarImageColorChangedNotificationName, object: nil)
|
|
|
+
|
|
|
+ NotificationCenter.default.post(name: toolbarImageColorChangedNotificationName, object: nil)
|
|
|
}
|
|
|
|
|
|
if let resultOpacity = opacity {
|
|
@@ -248,7 +248,8 @@ class KMHighlightController: NSViewController {
|
|
|
//MARK: - ComponentCColorDelegate
|
|
|
extension KMHighlightController: ComponentCColorDelegate {
|
|
|
func componentCColorDidChooseColor(_ view: NSView, _ color: NSColor?) {
|
|
|
- CPDFMarkupAnnotation.update(annotations, color, PDFView: pdfView)
|
|
|
+
|
|
|
+ CPDFAnnotation.updateAnnotations(annotations, newColor: color, withPDFView: pdfView)
|
|
|
|
|
|
updateDefaultInfo(color, nil)
|
|
|
|
|
@@ -272,7 +273,7 @@ extension KMHighlightController: ComponentCColorDelegate {
|
|
|
extension KMHighlightController: ComponentSliderDelegate {
|
|
|
func componentSliderDidUpdate(_ view: ComponentSlider) {
|
|
|
let opacity = view.properties.percent
|
|
|
- CPDFMarkupAnnotation.update(annotations, opacity, withPDFView: pdfView)
|
|
|
+ CPDFAnnotation.updateAnnotations(annotations, newOpacity: opacity, withPDFView: pdfView)
|
|
|
|
|
|
updateDefaultInfo(nil, opacity)
|
|
|
|
|
@@ -288,7 +289,7 @@ extension KMHighlightController: ComponentSelectDelegate {
|
|
|
result = result.stringByDeleteCharString(textUnit)
|
|
|
}
|
|
|
let opacity = max(0, min(1, result.stringToCGFloat()/100))
|
|
|
- CPDFMarkupAnnotation.update(annotations, opacity, withPDFView: pdfView)
|
|
|
+ CPDFAnnotation.updateAnnotations(annotations, newOpacity: opacity, withPDFView: pdfView)
|
|
|
|
|
|
updateDefaultInfo(nil, opacity)
|
|
|
|
|
@@ -299,7 +300,7 @@ extension KMHighlightController: ComponentSelectDelegate {
|
|
|
func componentSelectTextDidEndEditing(_ view: ComponentSelect, removeUnit text: String?) {
|
|
|
if let result = text {
|
|
|
let opacity = max(0, min(1, result.stringToCGFloat()/100))
|
|
|
- CPDFMarkupAnnotation.update(annotations, opacity, withPDFView: pdfView)
|
|
|
+ CPDFAnnotation.updateAnnotations(annotations, newOpacity: opacity, withPDFView: pdfView)
|
|
|
|
|
|
updateDefaultInfo(nil, opacity)
|
|
|
|