|
@@ -373,25 +373,38 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
[menu insertItem:copyItem atIndex:0];
|
|
|
}
|
|
|
} else {
|
|
|
- CPDFAnnotation *annotation = nil;
|
|
|
- for (CPDFAnnotation *tAnnotation in page.annotations) {
|
|
|
- if ([tAnnotation hitTest:pagePoint]) {
|
|
|
- annotation = tAnnotation;
|
|
|
- break;
|
|
|
+ CPDFAnnotation *annotation = nil;
|
|
|
+
|
|
|
+ if (([self toolMode] == CTextToolMode || [self toolMode] == CNoteToolMode || [self toolMode] == CFormToolMode || [self toolMode] == CSelfSignMode || [self toolMode] == CRedactToolMode) && [self hideNotes] == NO) {
|
|
|
+
|
|
|
+ for (CPDFAnnotation *tAnnotation in page.annotations) {
|
|
|
+ if ([tAnnotation hitTest:pagePoint]) {
|
|
|
+ annotation = tAnnotation;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (annotation && [annotation isKindOfClass:[CPDFWidgetAnnotation class]] ){
|
|
|
+ if(CFormToolMode == self.toolMode)
|
|
|
+ annotation = nil;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(annotation) {
|
|
|
+ if(![self.activeAnnotations containsObject:annotation]) {
|
|
|
+ [self updateActiveAnnotations:@[annotation]];
|
|
|
+ [self setNeedsDisplayAnnotation:annotation];
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if (annotation && [annotation isKindOfClass:[CPDFWidgetAnnotation class]] ){
|
|
|
- if(CFormToolMode == self.toolMode)
|
|
|
- annotation = nil;
|
|
|
+
|
|
|
+ if(annotation && [annotation isKindOfClass:[CPDFWidgetAnnotation class]] && [self toolMode] != CFormToolMode) {
|
|
|
+ annotation = nil;
|
|
|
+ } else if(annotation && [annotation isKindOfClass:[CPDFRedactAnnotation class]] && [self toolMode] != CRedactToolMode) {
|
|
|
+ annotation = nil;
|
|
|
+ } else if (annotation && [annotation isKindOfClass:[CPDFInkAnnotation class]] && [self annotationType] == CAnnotationTypeInk) {
|
|
|
+ annotation = nil;
|
|
|
}
|
|
|
|
|
|
- if(annotation) {
|
|
|
- if(![self.activeAnnotations containsObject:annotation]) {
|
|
|
- [self updateActiveAnnotations:@[annotation]];
|
|
|
- [self setNeedsDisplayAnnotation:annotation];
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
CPDFSelection *selection = [self creatImageCurrentSelectionForPoint:[event locationInPDFListView:self]];
|
|
|
if(selection && CPDFSelectionTypeImage == [selection selectionType] && !self.activeAnnotation){
|
|
@@ -2589,15 +2602,15 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
startPoint = CGPointMake(startPoint.x - orgBounds.origin.x, startPoint.y - orgBounds.origin.y);
|
|
|
endPoint = CGPointMake(endPoint.x - orgBounds.origin.x, endPoint.y - orgBounds.origin.y);
|
|
|
|
|
|
- startPoint = CGPointMake(startPoint.x/orgBounds.size.width * newBounds.size.width, startPoint.y/orgBounds.size.height * newBounds.size.height);
|
|
|
- endPoint = CGPointMake(endPoint.x/orgBounds.size.width * newBounds.size.width, endPoint.y/orgBounds.size.height * newBounds.size.height);
|
|
|
+ startPoint = CGPointMake((startPoint.x/orgBounds.size.width) * newBounds.size.width, (startPoint.y/orgBounds.size.height) * newBounds.size.height);
|
|
|
+ endPoint = CGPointMake((endPoint.x/orgBounds.size.width) * newBounds.size.width, (endPoint.y/orgBounds.size.height) * newBounds.size.height);
|
|
|
|
|
|
- startPoint = CGPointMake(startPoint.x + orgBounds.origin.y, startPoint.y + orgBounds.origin.y);
|
|
|
- endPoint = CGPointMake(endPoint.x + orgBounds.origin.x, endPoint.y + orgBounds.origin.y);
|
|
|
+ startPoint = CGPointMake(startPoint.x + newBounds.origin.x, startPoint.y + newBounds.origin.y);
|
|
|
+ endPoint = CGPointMake(endPoint.x + newBounds.origin.x, endPoint.y + newBounds.origin.y);
|
|
|
|
|
|
[(CPDFLineAnnotation *)dragAnnotation setStartPoint:startPoint];
|
|
|
[(CPDFLineAnnotation *)dragAnnotation setEndPoint:endPoint];
|
|
|
- } else {
|
|
|
+ }
|
|
|
CGRect rect = CGRectMake(dragAnnotation.bounds.origin.x - orgBounds.origin.x, dragAnnotation.bounds.origin.y - orgBounds.origin.y, dragAnnotation.bounds.size.width, dragAnnotation.bounds.size.height);
|
|
|
|
|
|
CGFloat minX = CGRectGetMinX(rect);
|