Revision: 5005
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5005&view=rev
Author:   hofman
Date:     2008-11-27 16:10:27 +0000 (Thu, 27 Nov 2008)

Log Message:
-----------
No need to use separate method to draw unrotated, as it's now used only in one 
place

Modified Paths:
--------------
    trunk/PDFPage_SKExtensions.m

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2008-11-27 16:01:19 UTC (rev 5004)
+++ trunk/PDFPage_SKExtensions.m        2008-11-27 16:10:27 UTC (rev 5005)
@@ -91,33 +91,7 @@
     usesSequentialPageNumbering = flag;
 }
 
-- (void)drawUnrotatedWithBox:(PDFDisplayBox)box {
-    NSRect bounds = [self boundsForBox:box];
-    [NSGraphicsContext saveGraphicsState];
-    if ([self rotation]) {
-        NSAffineTransform *transform = [NSAffineTransform transform];
-        switch ([self rotation]) {
-            case 90:
-                [transform translateXBy:NSWidth(bounds) yBy:0.0];
-                break;
-            case 180:
-                [transform translateXBy:NSHeight(bounds) yBy:NSWidth(bounds)];
-                break;
-            case 270:
-                [transform translateXBy:0.0 yBy:NSHeight(bounds)];
-                break;
-        }
-        [transform rotateByDegrees:[self rotation]];
-        [transform concat];
-    }
-    [[self annotations] makeObjectsPerformSelector:@selector(hideIfTemporary)];
-    [self drawWithBox:box]; 
-    [[self annotations] 
makeObjectsPerformSelector:@selector(displayIfTemporary)];
-    [NSGraphicsContext restoreGraphicsState];
-}
-
 - (NSBitmapImageRep *)newBitmapImageRepForBox:(PDFDisplayBox)box {
-    
     NSRect bounds = [self boundsForBox:box];
     NSBitmapImageRep *imageRep;
     imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
@@ -136,7 +110,25 @@
         [NSGraphicsContext setCurrentContext:[NSGraphicsContext 
graphicsContextWithBitmapImageRep:imageRep]];
         [[NSGraphicsContext currentContext] 
setImageInterpolation:NSImageInterpolationNone];
         [[NSGraphicsContext currentContext] setShouldAntialias:NO];
-        [self drawUnrotatedWithBox:box];
+        if ([self rotation]) {
+            NSAffineTransform *transform = [NSAffineTransform transform];
+            switch ([self rotation]) {
+                case 90:
+                    [transform translateXBy:NSWidth(bounds) yBy:0.0];
+                    break;
+                case 180:
+                    [transform translateXBy:NSHeight(bounds) 
yBy:NSWidth(bounds)];
+                    break;
+                case 270:
+                    [transform translateXBy:0.0 yBy:NSHeight(bounds)];
+                    break;
+            }
+            [transform rotateByDegrees:[self rotation]];
+            [transform concat];
+        }
+        [[self annotations] 
makeObjectsPerformSelector:@selector(hideIfTemporary)];
+        [self drawWithBox:box]; 
+        [[self annotations] 
makeObjectsPerformSelector:@selector(displayIfTemporary)];
         [NSGraphicsContext restoreGraphicsState];
     }
     return imageRep;


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

Reply via email to