Browse Source

【快捷键】按住opt不能拷贝拖拽的项目(已修复)

tangchao 1 year ago
parent
commit
4e42ae898c

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

@@ -97,6 +97,31 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
                 }
             }
             [self setNeedsDisplayAnnotationViewForPage:page];
+            
+        } else if (modifiers == NSEventModifierFlagOption && [newActiveAnnotation isMovable]) {
+//            if ([newActiveAnnotation isKindOfClass:[CPDFSquareAnnotation class]] ||
+//                [newActiveAnnotation isKindOfClass:[CPDFCircleAnnotation class]] ||
+//                [newActiveAnnotation isKindOfClass:[CPDFLineAnnotation class]] ||
+//                [newActiveAnnotation isKindOfClass:[CPDFTextAnnotation class]]) {
+                CPDFAnnotation *newAnnotation = [newActiveAnnotation copy];
+                [self addAnnotation:newAnnotation toPage:page];
+                //            [self addAnnotationWithType:CAnnotationTypeSquare selection:nil page:page bounds:newActiveAnnotation.bounds];
+                //            newActiveAnnotation.shouldDisplay = YES;
+                newActiveAnnotation = newAnnotation;
+                [self updateActiveAnnotations:@[newActiveAnnotation]];
+                [self setNeedsDisplayAnnotationViewForVisiblePages];
+                
+                if ([self consistentTypeWithAnnotation:newActiveAnnotation]) {
+                    [self doDragAnnotationWithEvent:theEvent forAnnotation:newActiveAnnotation];
+                }
+                //            dispatch_async(dispatch_get_main_queue(), ^{
+                //                [self setNeedsDisplayAnnotationViewForVisiblePages];
+                //            });
+//            } else {
+//                if ([self consistentTypeWithAnnotation:newActiveAnnotation]) {
+//                    [self doDragAnnotationWithEvent:theEvent forAnnotation:newActiveAnnotation];
+//                }
+//            }
         } else {
             if ([self consistentTypeWithAnnotation:newActiveAnnotation]) {
                 [self doDragAnnotationWithEvent:theEvent forAnnotation:newActiveAnnotation];