|
@@ -3546,80 +3546,62 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
}
|
|
|
} else if ([activeAnnotation isKindOfClass:[CPDFStampAnnotation class]] && isCreatAnnotation == NO) {
|
|
|
CPDFStampAnnotation *stampAnnotation = (CPDFStampAnnotation *)activeAnnotation;
|
|
|
- CPDFStampDraggedType draggedIndex = -1;
|
|
|
- if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
- draggedIndex = 2;
|
|
|
- } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
- draggedIndex = 4;
|
|
|
- } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
- draggedIndex = 6;
|
|
|
- } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
- draggedIndex = 0;
|
|
|
- } else if (resizeHandle & CMinXEdgeMask) {
|
|
|
- draggedIndex = 7;
|
|
|
- } else if (resizeHandle & CMaxXEdgeMask) {
|
|
|
- draggedIndex = 3;
|
|
|
- } else if (resizeHandle & CMinYEdgeMask) {
|
|
|
- draggedIndex = 1;
|
|
|
- } else if (resizeHandle & CMaxYEdgeMask) {
|
|
|
- draggedIndex = 5;
|
|
|
- }
|
|
|
- if (draggedIndex == -1) {
|
|
|
- return;
|
|
|
+ if(stampAnnotation == 0) {
|
|
|
+ [stampAnnotation setBounds:NSIntegralRect(newBounds)];
|
|
|
+ } else {
|
|
|
+ CPDFStampDraggedType draggedIndex = -1;
|
|
|
+ if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
+ draggedIndex = 2;
|
|
|
+ } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
+ draggedIndex = 4;
|
|
|
+ } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
+ draggedIndex = 6;
|
|
|
+ } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
+ draggedIndex = 0;
|
|
|
+ } else if (resizeHandle & CMinXEdgeMask) {
|
|
|
+ draggedIndex = 7;
|
|
|
+ } else if (resizeHandle & CMaxXEdgeMask) {
|
|
|
+ draggedIndex = 3;
|
|
|
+ } else if (resizeHandle & CMinYEdgeMask) {
|
|
|
+ draggedIndex = 1;
|
|
|
+ } else if (resizeHandle & CMaxYEdgeMask) {
|
|
|
+ draggedIndex = 5;
|
|
|
+ }
|
|
|
+ if (draggedIndex == -1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ [stampAnnotation dragStampAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
|
|
|
}
|
|
|
- [stampAnnotation dragStampAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
|
|
|
}
|
|
|
else if ([activeAnnotation isKindOfClass:[CPDFSignatureAnnotation class]] && isCreatAnnotation == NO) {
|
|
|
CPDFSignatureAnnotation *signatureAnnotation = (CPDFSignatureAnnotation *)activeAnnotation;
|
|
|
- CPDFSignatureDraggedType draggedIndex = -1;
|
|
|
- if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
- draggedIndex = 2;
|
|
|
- } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
- draggedIndex = 4;
|
|
|
- } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
- draggedIndex = 6;
|
|
|
- } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
- draggedIndex = 0;
|
|
|
- } else if (resizeHandle & CMinXEdgeMask) {
|
|
|
- draggedIndex = 7;
|
|
|
- } else if (resizeHandle & CMaxXEdgeMask) {
|
|
|
- draggedIndex = 3;
|
|
|
- } else if (resizeHandle & CMinYEdgeMask) {
|
|
|
- draggedIndex = 1;
|
|
|
- } else if (resizeHandle & CMaxYEdgeMask) {
|
|
|
- draggedIndex = 5;
|
|
|
- }
|
|
|
- if (draggedIndex == -1) {
|
|
|
- return;
|
|
|
+ if(signatureAnnotation == 0) {
|
|
|
+ [signatureAnnotation setBounds:NSIntegralRect(newBounds)];
|
|
|
+ } else {
|
|
|
+ CPDFSignatureDraggedType draggedIndex = -1;
|
|
|
+ if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
+ draggedIndex = 2;
|
|
|
+ } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
+ draggedIndex = 4;
|
|
|
+ } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
+ draggedIndex = 6;
|
|
|
+ } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
+ draggedIndex = 0;
|
|
|
+ } else if (resizeHandle & CMinXEdgeMask) {
|
|
|
+ draggedIndex = 7;
|
|
|
+ } else if (resizeHandle & CMaxXEdgeMask) {
|
|
|
+ draggedIndex = 3;
|
|
|
+ } else if (resizeHandle & CMinYEdgeMask) {
|
|
|
+ draggedIndex = 1;
|
|
|
+ } else if (resizeHandle & CMaxYEdgeMask) {
|
|
|
+ draggedIndex = 5;
|
|
|
+ }
|
|
|
+ if (draggedIndex == -1) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ [signatureAnnotation dragSignatureAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
|
|
|
}
|
|
|
- [signatureAnnotation dragSignatureAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
|
|
|
- }
|
|
|
-// else if ([activeAnnotation isKindOfClass:[CPDFSignatureWidgetAnnotation class]]) {
|
|
|
-// CPDFSignatureWidgetAnnotation *signatureWidgetAnnotation = (CPDFSignatureWidgetAnnotation *)activeAnnotation;
|
|
|
-// CPDFSignatureWidgetDraggedType draggedIndex = -1;
|
|
|
-// if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
-// draggedIndex = 2;
|
|
|
-// } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
-// draggedIndex = 4;
|
|
|
-// } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
|
|
|
-// draggedIndex = 6;
|
|
|
-// } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
|
|
|
-// draggedIndex = 0;
|
|
|
-// } else if (resizeHandle & CMinXEdgeMask) {
|
|
|
-// draggedIndex = 7;
|
|
|
-// } else if (resizeHandle & CMaxXEdgeMask) {
|
|
|
-// draggedIndex = 3;
|
|
|
-// } else if (resizeHandle & CMinYEdgeMask) {
|
|
|
-// draggedIndex = 1;
|
|
|
-// } else if (resizeHandle & CMaxYEdgeMask) {
|
|
|
-// draggedIndex = 5;
|
|
|
-// }
|
|
|
-// if (draggedIndex == -1) {
|
|
|
-// return;
|
|
|
-// }
|
|
|
-// [signatureWidgetAnnotation dragSignatureWidgetAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
|
|
|
-// }
|
|
|
- else {
|
|
|
+ } else {
|
|
|
[activeAnnotation setBounds:NSIntegralRect(newBounds)];
|
|
|
}
|
|
|
|
|
@@ -5591,8 +5573,8 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
|
|
|
newAnnotation.lineOpacity = originalAnnotation.lineOpacity;
|
|
|
newAnnotation.lineColor = originalAnnotation.lineColor;
|
|
|
|
|
|
- [self addActiveAnnotations:@[newAnnotation]];
|
|
|
[self addAnnotation:newAnnotation toPage:page];
|
|
|
+ [self addActiveAnnotations:@[newAnnotation]];
|
|
|
[newAnnotation updateAppearanceStream];
|
|
|
} else if ([an isKindOfClass:[CPDFListStampAnnotation class]]) {
|
|
|
CPDFListStampAnnotation *newAnnotation = nil;
|