Przeglądaj źródła

【视图】物件隐藏实现方式调整

lizhe 1 rok temu
rodzic
commit
358f443b88

+ 2 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -262,7 +262,8 @@ NSNotificationName const CPDFListViewAnnotationsAttributeHasChangeNotification =
     for(NSInteger i = 0;i<self.document.pageCount;i++) {
         CPDFPage *page = [self.document pageAtIndex:i];
         for (CPDFAnnotation *annotation in page.annotations) {
-            [annotation setAnnotationShouldDisplay:!self.hideNotes];
+//            [annotation setAnnotationShouldDisplay:!self.hideNotes];
+            [annotation setHidden: self.hideNotes];
         }
     }
     [self setNeedsDisplayAnnotationViewForVisiblePages];

+ 4 - 4
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -198,7 +198,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
     
     CPDFAnnotation *newActiveAnnotation = nil;
     for (CPDFAnnotation *annotation in annotations) {
-        if ([annotation hitTest:point] && [annotation annotationShouldDisplay]) {
+        if ([annotation hitTest:point] && [annotation isHidden]) {
             newActiveAnnotation = annotation;
             break;
         }
@@ -2616,7 +2616,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
     id annotations = [page annotations];
     
     for (CPDFAnnotation *annotation in annotations) {
-        if ([annotation hitTest:point] && [annotation annotationShouldDisplay] ) {
+        if ([annotation hitTest:point] && [annotation isHidden] ) {
             newActiveAnnotation = annotation;
             break;
         }
@@ -2663,7 +2663,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
     if ([self.activeAnnotation page] == page &&
         [self.activeAnnotation isResizable] &&
         [self.activeAnnotation resizeHandleForPoint:point scaleFactor:[self scaleFactor]] != 0 &&
-        [self.activeAnnotation annotationShouldDisplay]) {
+        [self.activeAnnotation isHidden]) {
         *annotation = self.activeAnnotation;
         return YES;
     }
@@ -3075,7 +3075,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
         theEvent = [[self window] nextEventMatchingMask:eventMask];
         if ([theEvent type] == NSEventTypeLeftMouseUp) {
             for(CPDFAnnotation *annotation in [activePage annotations]){
-                if ([annotation annotationShouldDisplay] && NSIntersectsRect(annotation.bounds, selectBounds) &&
+                if ([annotation isHidden] && NSIntersectsRect(annotation.bounds, selectBounds) &&
                     ![annotation isKindOfClass:[CPDFLinkAnnotation class]] &&
                     ![annotation isKindOfClass:[CPDFButtonWidgetAnnotation class]] &&
                     ![annotation isKindOfClass:[CPDFTextWidgetAnnotation class]] &&

+ 1 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Annotation/KMAnnotationViewController.swift

@@ -155,7 +155,7 @@ extension KMAnnotationViewController {
                 }
                 
                 for annotation in pageAnnotations {
-                    if annotation.annotationShouldDisplay() == false {
+                    if annotation.isHidden() {
                         pageAnnotations.removeObject(annotation)
                     }
                 }

+ 1 - 3
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/Thumbnail/KMPDFThumbnailItem.swift

@@ -76,9 +76,7 @@ class KMPDFThumbnailItem: NSCollectionViewItem {
         didSet {
             if self.annotationShowState == .hidden {
                 for annotation in self.page.annotations {
-                    if annotation.annotationShouldDisplay() == false {
-                        annotation.setHidden(true)
-                    }
+                    annotation.setHidden(true)
                 }
             } else {
                 for annotation in self.page.annotations {