|
@@ -244,6 +244,17 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
|
|
|
if(!self.isEditing) {
|
|
|
[self.dragHoverPoints removeAllObjects];
|
|
|
+
|
|
|
+ BOOL isIncludeText = NO;
|
|
|
+ NSMutableArray *currentActiveAnnotations = [NSMutableArray array];
|
|
|
+ for (CPDFAnnotation *an in self.activeAnnotations) {
|
|
|
+ if([an.page isEqual:page]) {
|
|
|
+ if([an isKindOfClass:[CPDFFreeTextAnnotation class]])
|
|
|
+ isIncludeText = YES;
|
|
|
+
|
|
|
+ [currentActiveAnnotations addObject:an];
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if(CNoteToolMode == self.toolMode ||
|
|
|
CTextToolMode == self.toolMode ||
|
|
@@ -251,19 +262,9 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
CSelfSignMode == self.toolMode ||
|
|
|
CRedactToolMode == self.toolMode ||
|
|
|
CRedactErasureToolMode == self.toolMode) {
|
|
|
- if(self.activeAnnotations.count > 1) {
|
|
|
- NSRect rect = [self selectionMultipleAnnotationBoundsWithPage:page];
|
|
|
+ if(currentActiveAnnotations.count > 1) {
|
|
|
+ NSRect rect = [self selectionMultipleBoundsWithAnnotations:currentActiveAnnotations];
|
|
|
CRectEdges resizeHandle = CPDFListViewResizeHandleForPointFromRect(point, rect, 4.0 / [self scaleFactor]);
|
|
|
- BOOL isIncludeText = NO;
|
|
|
-
|
|
|
- if(self.activeAnnotations.count > 1) {
|
|
|
- for (CPDFAnnotation *an in self.activeAnnotations) {
|
|
|
- if([an isKindOfClass:[CPDFFreeTextAnnotation class]]) {
|
|
|
- isIncludeText = YES;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
if (isIncludeText) {
|
|
|
if (((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) ||
|
|
@@ -2257,9 +2258,16 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-- (void)doMutResizeDragOffsetPoint:(CGPoint)relPoint resizeHandle:(CRectEdges *)resizeHandlePtr {
|
|
|
- CPDFPage *page = self.activeAnnotation.page;
|
|
|
- CGRect orgBounds = [self selectionMultipleAnnotationBoundsWithPage:page];
|
|
|
+- (void)doMutResizeDragOffsetPoint:(CGPoint)relPoint page:(CPDFPage *)page resizeHandle:(CRectEdges *)resizeHandlePtr {
|
|
|
+
|
|
|
+ NSMutableArray *currentActiveAnnotations = [NSMutableArray array];
|
|
|
+ for (CPDFAnnotation *an in self.activeAnnotations) {
|
|
|
+ if([an.page isEqual:page]) {
|
|
|
+ [currentActiveAnnotations addObject:an];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ CGRect orgBounds = [self selectionMultipleBoundsWithAnnotations:currentActiveAnnotations];
|
|
|
NSRect newBounds = orgBounds;
|
|
|
|
|
|
CRectEdges resizeHandle = *resizeHandlePtr;
|
|
@@ -2438,8 +2446,15 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
return YES;
|
|
|
}
|
|
|
|
|
|
- if(self.activeAnnotations.count > 1) {
|
|
|
- NSRect rect = [self selectionMultipleAnnotationBoundsWithPage:page];
|
|
|
+ NSMutableArray *currentActiveAnnotations = [NSMutableArray array];
|
|
|
+ for (CPDFAnnotation *an in self.activeAnnotations) {
|
|
|
+ if([an.page isEqual:page]) {
|
|
|
+ [currentActiveAnnotations addObject:an];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(currentActiveAnnotations.count > 1) {
|
|
|
+ NSRect rect = [self selectionMultipleBoundsWithAnnotations:currentActiveAnnotations];
|
|
|
CRectEdges resizeHandle = CPDFListViewResizeHandleForPointFromRect(point, rect, 4.0 / [self scaleFactor]);
|
|
|
if(resizeHandle != 0) {
|
|
|
*annotation = self.activeAnnotation;
|
|
@@ -2505,24 +2520,22 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
- (void)doDragMultipleAnnotationWithEvent:(NSEvent *)theEvent {
|
|
|
NSPoint pagePoint = NSZeroPoint;
|
|
|
CPDFPage *page = [self pageAndPoint:&pagePoint forEvent:theEvent nearest:YES];
|
|
|
+ NSMutableArray *currentActiveAnnotations = [NSMutableArray array];
|
|
|
+ BOOL isIncludText = NO;
|
|
|
+ for (CPDFAnnotation *an in self.activeAnnotations) {
|
|
|
+ if([an.page isEqual:page]) {
|
|
|
+ [currentActiveAnnotations addObject:an];
|
|
|
+ if([an isKindOfClass:[CPDFFreeTextAnnotation class]])
|
|
|
+ isIncludText = YES;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
NSUInteger eventMask = NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged;
|
|
|
NSEvent *lastMouseEvent = theEvent;
|
|
|
- NSRect rect = [self selectionMultipleAnnotationBoundsWithPage:page];
|
|
|
+ NSRect rect = [self selectionMultipleBoundsWithAnnotations:currentActiveAnnotations];
|
|
|
CRectEdges resizeHandle = CPDFListViewResizeHandleForPointFromRect(pagePoint, rect, 4.0 / [self scaleFactor]);
|
|
|
|
|
|
- BOOL isIncludeText = NO;
|
|
|
-
|
|
|
- if(self.activeAnnotations.count > 1) {
|
|
|
- for (CPDFAnnotation *an in self.activeAnnotations) {
|
|
|
- if([an isKindOfClass:[CPDFFreeTextAnnotation class]]) {
|
|
|
- isIncludeText = YES;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (isIncludeText) {
|
|
|
+ if (isIncludText) {
|
|
|
if (((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) ||
|
|
|
((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) ||
|
|
|
((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) ||
|
|
@@ -2557,7 +2570,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
if (CGRectContainsPoint(zRect, point)) {continue;}
|
|
|
|
|
|
[self.dragHoverPoints removeAllObjects];
|
|
|
- CGRect borderRect = [self selectionMultipleAnnotationBoundsWithPage:page];
|
|
|
+ CGRect borderRect = [self selectionMultipleBoundsWithAnnotations:currentActiveAnnotations];
|
|
|
[self.dragHoverPoints addObjectsFromArray:[self dragHoverPointsForRect:borderRect forPage:page resizeHandle:resizeHandle]];
|
|
|
NSPoint relPoint = CPDFListViewSubstractPoints(point, lastPoint);
|
|
|
if(CGRectGetMinX(borderRect) + relPoint.x < 0) {
|
|
@@ -2590,7 +2603,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
|
|
|
lastMouseEvent = theEvent;
|
|
|
} else {
|
|
|
- [self doMutResizeDragOffsetPoint:relPoint resizeHandle:&resizeHandle];;
|
|
|
+ [self doMutResizeDragOffsetPoint:relPoint page:page resizeHandle:&resizeHandle];
|
|
|
|
|
|
lastMouseEvent = theEvent;
|
|
|
}
|