Ver código fonte

【注释】修复‘添加form,能添加成功到页面范围外,导致显示不全’

wanjun 9 meses atrás
pai
commit
5d86880a28

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

@@ -3487,6 +3487,13 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
         while (YES) {
             if ([theEvent type] == NSLeftMouseUp) {
                 CGRect bounds =CGRectMake(pagePoint.x - 10, pagePoint.y - 10, 20, 20);
+                
+                CGFloat mouseOffset = [self unitWidthOnPage:page];
+                CGPoint zPoint = pagePoint;
+                [self pageAndPoint:&zPoint forEvent:theEvent nearest:YES];
+                CGRect zRect = CGRectMake(pagePoint.x-2*mouseOffset, pagePoint.y-2*mouseOffset, 4*mouseOffset, 4*mouseOffset);
+                if (CGRectContainsPoint(zRect, zPoint)) {continue;}
+
                 [self addFormAnnotationWithType:self.annotationType selection:nil page:page bounds:bounds];
                 break;
             }