Revision: 3940
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3940&view=rev
Author:   hofman
Date:     2008-05-30 09:05:13 -0700 (Fri, 30 May 2008)

Log Message:
-----------
Select crop box when setting selection page

Modified Paths:
--------------
    trunk/SKPDFDocument.m
    trunk/SKPDFView.m

Modified: trunk/SKPDFDocument.m
===================================================================
--- trunk/SKPDFDocument.m       2008-05-30 15:32:20 UTC (rev 3939)
+++ trunk/SKPDFDocument.m       2008-05-30 16:05:13 UTC (rev 3940)
@@ -1845,8 +1845,7 @@
 }
 
 - (void)setSelectionPage:(PDFPage *)page {
-    if (NSIsEmptyRect([[self pdfView] currentSelectionRect]) == NO)
-        [[self pdfView] setCurrentSelectionPage:[page isKindOfClass:[PDFPage 
class]] ? page : nil];
+    [[self pdfView] setCurrentSelectionPage:[page isKindOfClass:[PDFPage 
class]] ? page : nil];
 }
 
 - (NSDictionary *)pdfViewSettings {

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-05-30 15:32:20 UTC (rev 3939)
+++ trunk/SKPDFView.m   2008-05-30 16:05:13 UTC (rev 3940)
@@ -596,9 +596,14 @@
     if (toolMode == SKSelectToolMode) {
         if (NSEqualRects(selectionRect, rect) == NO)
             [self setNeedsDisplay:YES];
-        selectionRect = rect;
-        if (NSEqualRects(rect, NSZeroRect))
+        if (NSIsEmptyRect(rect)) {
+            selectionRect = NSZeroRect;
             selectionPageIndex = NSNotFound;
+        } else {
+            selectionRect = rect;
+            if (selectionPageIndex == NSNotFound)
+                selectionPageIndex = [[self currentPage] pageIndex];
+        }
     }
 }
 
@@ -610,9 +615,14 @@
     if (toolMode == SKSelectToolMode) {
         if (selectionPageIndex != [page pageIndex] || (page == nil && 
selectionPageIndex != NSNotFound))
             [self setNeedsDisplay:YES];
-       selectionPageIndex = [page pageIndex];
-       if (page == nil)
+        if (page == nil) {
+            selectionPageIndex = NSNotFound;
             selectionRect = NSZeroRect;
+        } else {
+            selectionPageIndex = [page pageIndex];
+            if (NSIsEmptyRect(selectionRect))
+                selectionRect = [page boundsForBox:kPDFDisplayBoxCropBox];
+        }
     }
 }
 


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to