|
@@ -769,7 +769,7 @@ extension KMLeftSideViewController {
|
|
|
func reloadAnnotation() {
|
|
|
if self.listView != nil {
|
|
|
let filterKey = self.pdfDocument()?.documentURL.path ?? ""
|
|
|
- let typeArr: [Any] = KMBotaTools.noteFilterAnnoTypes(key: filterKey)
|
|
|
+ let typeArr: [String] = KMBotaTools.noteFilterAnnoTypes(key: filterKey)
|
|
|
let colorArr: [Any] = KMBotaTools.noteFilterColors(key: filterKey)
|
|
|
let authorArr: [Any] = KMBotaTools.noteFilterAuthors(key: filterKey)
|
|
|
if typeArr.count == 0 && colorArr.count == 0 && authorArr.count == 0 {
|
|
@@ -796,7 +796,11 @@ extension KMLeftSideViewController {
|
|
|
annotationArray += allAnnos
|
|
|
|
|
|
if typeArr.count > 0 {
|
|
|
- filterAnnos = (KMOCToolClass.filterAnnotation(annotations: filterAnnos, types: typeArr) as? [CPDFAnnotation]) ?? []
|
|
|
+ var theTypes = typeArr
|
|
|
+ if typeArr.contains(CPDFAnnotation.kType.measureArrow) && typeArr.contains(CPDFAnnotation.kType.arrow) == false {
|
|
|
+ theTypes.append(CPDFAnnotation.kType.arrow)
|
|
|
+ }
|
|
|
+ filterAnnos = (KMOCToolClass.filterAnnotation(annotations: filterAnnos, types: theTypes) as? [CPDFAnnotation]) ?? []
|
|
|
}
|
|
|
if (colorArr.count > 0) {
|
|
|
filterAnnos = (KMOCToolClass.filterAnnotation(annotations: filterAnnos,colors: colorArr) as? [CPDFAnnotation]) ?? []
|
|
@@ -804,12 +808,19 @@ extension KMLeftSideViewController {
|
|
|
if (authorArr.count > 0) {
|
|
|
filterAnnos = (KMOCToolClass.filterAnnotation(annotations: filterAnnos,authors: authorArr) as? [CPDFAnnotation]) ?? []
|
|
|
}
|
|
|
- if types.contains("Arrow_Measure") {
|
|
|
-
|
|
|
+
|
|
|
+ if typeArr.contains(CPDFAnnotation.kType.measureArrow) {
|
|
|
+ if typeArr.contains(CPDFAnnotation.kType.arrow) == false {
|
|
|
+ for anno in filterAnnos {
|
|
|
+ if let data = anno as? CPDFLineAnnotation, data.type == CPDFAnnotation.kType.arrow && data.isMeasure == false {
|
|
|
+ filterAnnos.removeObject(anno)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
} else {
|
|
|
- for anno in annos {
|
|
|
+ for anno in filterAnnos {
|
|
|
if let data = anno as? CPDFLineAnnotation, data.isMeasure {
|
|
|
- annos.removeObject(anno)
|
|
|
+ filterAnnos.removeObject(anno)
|
|
|
}
|
|
|
}
|
|
|
}
|