@@ -384,7 +384,7 @@ class KMTTSWindowController: NSWindowController, KMTTSManagerDelegate, NSWindowD
//MARK: KMTTSManagerDelegate
func ttsMananger(_ tts: KMTTSManager, willSpeak selection: CPDFSelection) {
// if (selection != nil) {
- self.pdfView.setHighlightedSelection(selection, animated: false)
+ self.pdfView?.setHighlightedSelection(selection, animated: false)
// }
}
func ttsManangerDidFinishSpeech(_ tts: KMTTSManager) -> Bool {
@@ -111,7 +111,8 @@ import Cocoa
var annotation: CPDFAnnotation {
set {
- let equal: Bool = ((_annotation?.isEqual(newValue)) != nil)
+// let equal: Bool = ((_annotation?.isEqual(newValue)) != nil)
+ let equal = self._annotation?.isEqual(to: newValue) ?? false
if equal {
if _annotation is CPDFTextAnnotation {
let keys = ["string", "color"]