Revision: 14613
http://sourceforge.net/p/skim-app/code/14613
Author: hofman
Date: 2024-10-30 17:32:04 +0000 (Wed, 30 Oct 2024)
Log Message:
-----------
use media box to draw annotation
Modified Paths:
--------------
trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2024-10-30 17:30:36 UTC
(rev 14612)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2024-10-30 17:32:04 UTC
(rev 14613)
@@ -171,7 +171,7 @@
[page addAnnotation:annotation];
needsRemove = YES;
}
- CGRect bounds = [page boundsForBox:kPDFDisplayBoxCropBox];
+ CGRect bounds = [page boundsForBox:kPDFDisplayBoxMediaBox];
UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc]
initWithSize:rect.size];
UIImage *image = [renderer
imageWithActions:^(UIGraphicsImageRendererContext *context) {
CGContextRef *ctxt = [context CGContext];
@@ -191,7 +191,7 @@
break;
}
CGContextRotateCTM(ctx, [page rotation] * M_PI / 180.0);
- [annotation drawWithBox:kPDFDisplayBoxCropBox inContext:ctxt];
+ [annotation drawWithBox:kPDFDisplayBoxMediaBox inContext:ctxt];
}];
if (needsRmove)
[page removeAnnotation:annotation];
@@ -210,7 +210,7 @@
[page addAnnotation:annotation];
needsRemove = YES;
}
- NSRect bounds = [page boundsForBox:kPDFDisplayBoxCropBox];
+ NSRect bounds = [page boundsForBox:kPDFDisplayBoxMediaBox];
NSImage *image = [[NSImage alloc] initWithSize:rect.size];
[image lockFocus];
NSAffineTransform *transform = [NSAffineTransform transform];
@@ -224,7 +224,7 @@
[transform concat];
#if !defined(MAC_OS_X_VERSION_10_12) || MAC_OS_X_VERSION_MIN_REQUIRED <
MAC_OS_X_VERSION_10_12
if ([annotation respondsToSelector:@selector(drawWithBox:inContext:)] ==
NO)
- [annotation drawWithBox:kPDFDisplayBoxCropBox];
+ [annotation drawWithBox:kPDFDisplayBoxMediaBox];
else
#endif
[annotation drawWithBox:kPDFDisplayBoxCropBox
inContext:[[NSGraphicsContext currentContext] CGContext]];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit