|
@@ -547,6 +547,31 @@ CGFloat DEFAULT_SNAPSHOT_HEIGHT = 200.0;
|
|
|
else NSBeep();
|
|
|
}
|
|
|
|
|
|
+- (void)rotateStampAnnotation:(CPDFListStampAnnotation *)annotation rotateAngle:(NSInteger)angle {
|
|
|
+ if([annotation isKindOfClass:[CPDFListStampAnnotation class]]) {
|
|
|
+ CPDFListStampAnnotation *stampAnnotation = (CPDFListStampAnnotation *)annotation;
|
|
|
+ NSInteger rotation = stampAnnotation.rotation;
|
|
|
+ rotation = rotation - angle;
|
|
|
+
|
|
|
+ if (rotation < 0) {
|
|
|
+ rotation += 360;
|
|
|
+ } else if (rotation >= 360) {
|
|
|
+ rotation-=360;
|
|
|
+ }
|
|
|
+
|
|
|
+ [annotation setRotation:rotation];
|
|
|
+ rotation = [annotation appearanceStreamRotation];
|
|
|
+
|
|
|
+ NSImage *oldImage = [annotation.pImage copy];
|
|
|
+ NSImage *newImage = [self changeImage:oldImage alphaValue:annotation.opacity];
|
|
|
+ [annotation updateAppearanceStreamWithImage:newImage rotation:annotation.rotation];
|
|
|
+
|
|
|
+ [self setNeedsDisplayAnnotationViewForPage:annotation.page];
|
|
|
+
|
|
|
+ [[[self undoManager] prepareWithInvocationTarget:self] rotateStampAnnotation:annotation rotateAngle:-angle];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
- (void)setStampAnnotation:(CPDFListStampAnnotation *)annotation forImageAlpha:(CGFloat)alpha {
|
|
|
[[[self undoManager] prepareWithInvocationTarget:self] setStampAnnotation:annotation forImageAlpha:annotation.opacity];
|
|
|
|
|
@@ -555,7 +580,8 @@ CGFloat DEFAULT_SNAPSHOT_HEIGHT = 200.0;
|
|
|
NSImage *oldImage = [annotation.pImage copy];
|
|
|
NSImage *newImage = [self changeImage:oldImage alphaValue:alpha];
|
|
|
|
|
|
- [annotation updateAppearanceStreamWithImage:newImage];
|
|
|
+// [annotation updateAppearanceStreamWithImage:newImage];
|
|
|
+ [annotation updateAppearanceStreamWithImage:newImage rotation:annotation.rotation];
|
|
|
[self setNeedsDisplayAnnotation:annotation];
|
|
|
}
|
|
|
|