فهرست منبع

【注释】先选中页面上的文本,再点击工具栏的高亮\图形等注释,添加完注释后不会自动被选中

lizhe 9 ماه پیش
والد
کامیت
3ada92f524
1فایلهای تغییر یافته به همراه5 افزوده شده و 18 حذف شده
  1. 5 18
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

+ 5 - 18
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController+UI.swift

@@ -310,9 +310,11 @@ extension KMMainViewController: KMToolbarControllerDelegate {
             self.listView.annotationType = .unkown
             self.closeRightPane()
         } else {
-            if let type = CAnnotationType(rawValue: item.tag) {
-                self.trackEvent(annotationType: type)
-            }
+            let type = CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown
+            self.trackEvent(annotationType: type)
+
+            self.listView.annotationType = type
+            
             if self.listView.currentSelection != nil {
               let annotation = self.listView.addAnnotation(with: CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown, selection: self.listView.currentSelection, page: self.listView.currentSelection.page, bounds: self.listView.currentSelection.bounds)
                 if((annotation != nil) &&
@@ -325,21 +327,6 @@ extension KMMainViewController: KMToolbarControllerDelegate {
 
             }
             self.refreshListViewToolMode()
-            let type = CAnnotationType(rawValue: item.tag) ?? CAnnotationType.unkown
-            var annotations: [CPDFAnnotation] = []
-            if (type == .link) {
-                for annotation in self.listView.activeAnnotations {
-                    if ((annotation is CPDFLinkAnnotation) == false) {
-                        continue
-                    }
-                    annotations.append(annotation as! CPDFAnnotation)
-                }
-            }
-            
-            self.listView.annotationType = type
-            if (type == .link && annotations.count > 0) {
-                self.listView.updateActiveAnnotations(annotations)
-            }
         }
         
         if self.listView.toolMode != .editPDFToolMode && self.listView.annotationType != .unkown {