|
@@ -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 {
|