Revision: 5001
http://skim-app.svn.sourceforge.net/skim-app/?rev=5001&view=rev
Author: hofman
Date: 2008-11-27 12:24:20 +0000 (Thu, 27 Nov 2008)
Log Message:
-----------
rotate after translate transform to avoid some rounding errors
Modified Paths:
--------------
trunk/NSBitmapImageRep_SKExtensions.m
trunk/PDFPage_SKExtensions.m
trunk/SKPDFToolTipWindow.m
Modified: trunk/NSBitmapImageRep_SKExtensions.m
===================================================================
--- trunk/NSBitmapImageRep_SKExtensions.m 2008-11-27 12:20:18 UTC (rev
5000)
+++ trunk/NSBitmapImageRep_SKExtensions.m 2008-11-27 12:24:20 UTC (rev
5001)
@@ -197,18 +197,18 @@
int rotation = [page rotation];
if (rotation) {
NSAffineTransform *transform = [NSAffineTransform transform];
- [transform rotateByDegrees:rotation];
switch (rotation) {
case 90:
- [transform translateXBy:0.0 yBy:-NSWidth(bounds)];
+ [transform translateXBy:NSWidth(bounds) yBy:0.0];
break;
case 180:
- [transform translateXBy:-NSWidth(bounds)
yBy:-NSHeight(bounds)];
+ [transform translateXBy:NSWidth(bounds)
yBy:NSHeight(bounds)];
break;
case 270:
- [transform translateXBy:-NSHeight(bounds) yBy:0.0];
+ [transform translateXBy:0.0 yBy:NSHeight(bounds)];
break;
}
+ [transform rotateByDegrees:rotation];
[transform concat];
}
[page drawWithBox:box];
Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m 2008-11-27 12:20:18 UTC (rev 5000)
+++ trunk/PDFPage_SKExtensions.m 2008-11-27 12:24:20 UTC (rev 5001)
@@ -132,18 +132,18 @@
NSRectFill(bounds);
if ([self rotation]) {
NSAffineTransform *transform = [NSAffineTransform transform];
- [transform rotateByDegrees:[self rotation]];
switch ([self rotation]) {
case 90:
- [transform translateXBy:0.0 yBy:-NSWidth(bounds)];
+ [transform translateXBy:NSWidth(bounds) yBy:0.0];
break;
case 180:
- [transform translateXBy:-NSWidth(bounds)
yBy:-NSHeight(bounds)];
+ [transform translateXBy:NSHeight(bounds) yBy:NSWidth(bounds)];
break;
case 270:
- [transform translateXBy:-NSHeight(bounds) yBy:0.0];
+ [transform translateXBy:0.0 yBy:NSHeight(bounds)];
break;
}
+ [transform rotateByDegrees:[self rotation]];
[transform concat];
}
[[self annotations] makeObjectsPerformSelector:@selector(hideIfTemporary)];
Modified: trunk/SKPDFToolTipWindow.m
===================================================================
--- trunk/SKPDFToolTipWindow.m 2008-11-27 12:20:18 UTC (rev 5000)
+++ trunk/SKPDFToolTipWindow.m 2008-11-27 12:24:20 UTC (rev 5001)
@@ -210,21 +210,21 @@
PDFSelection *selection = [page selectionForRect:bounds];
NSAffineTransform *transform = [NSAffineTransform transform];
- [transform rotateByDegrees:-[page rotation]];
switch ([page rotation]) {
case 0:
[transform translateXBy:-NSMinX(bounds)
yBy:-NSMinY(bounds)];
break;
case 90:
- [transform translateXBy:-NSMaxX(bounds)
yBy:-NSMinY(bounds)];
+ [transform translateXBy:-NSMinY(bounds)
yBy:NSMaxX(bounds)];
break;
case 180:
- [transform translateXBy:-NSMaxX(bounds)
yBy:-NSMaxY(bounds)];
+ [transform translateXBy:NSMaxX(bounds) yBy:NSMaxY(bounds)];
break;
case 270:
- [transform translateXBy:-NSMinX(bounds)
yBy:-NSMaxY(bounds)];
+ [transform translateXBy:NSMaxY(bounds)
yBy:-NSMinX(bounds)];
break;
}
+ [transform rotateByDegrees:-[page rotation]];
bounds = [transform transformRect:bounds];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit