Revision: 6684
          http://skim-app.svn.sourceforge.net/skim-app/?rev=6684&view=rev
Author:   hofman
Date:     2010-08-09 21:31:23 +0000 (Mon, 09 Aug 2010)

Log Message:
-----------
only reset position in secondary pdfview when it's shown for the first time, 
otherwise leave it where it was.

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

Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m      2010-08-09 21:24:58 UTC (rev 
6683)
+++ trunk/SKMainWindowController_Actions.m      2010-08-09 21:31:23 UTC (rev 
6684)
@@ -938,8 +938,8 @@
             lastSplitPDFHeight = floor(0.3 * NSHeight(frame));
         
         CGFloat position = NSHeight(frame) - lastSplitPDFHeight - 
[pdfSplitView dividerThickness];
-        NSPoint point = NSMakePoint(NSMinX(frame), NSMaxY(frame) - position - 
[pdfSplitView dividerThickness]);
-        PDFPage *page = [pdfView pageForPoint:point nearest:YES];
+        NSPoint point = NSZeroPoint;
+        PDFPage *page = nil;
         
         if (secondaryPdfView == nil) {
             secondaryPdfContentView = [[NSView alloc] init];
@@ -957,6 +957,8 @@
             [secondaryPdfView setGreekingThreshold:[[NSUserDefaults 
standardUserDefaults] floatForKey:SKGreekingThresholdKey]];
             [secondaryPdfView setSynchronizeZoom:YES];
             [secondaryPdfView setDocument:[pdfView document]];
+            point = NSMakePoint(NSMinX(frame), NSMaxY(frame) - position - 
[pdfSplitView dividerThickness]);
+            page = [pdfView pageForPoint:point nearest:YES];
         } else {
             [secondaryPdfContentView setHidden:YES];
             [pdfSplitView addSubview:secondaryPdfContentView];
@@ -964,10 +966,12 @@
         
         [pdfSplitView setPosition:position ofDividerAtIndex:0 animate:YES];
         
-        point = [secondaryPdfView convertPoint:[secondaryPdfView 
convertPoint:[pdfView convertPoint:point toPage:page] fromPage:page] 
toView:[secondaryPdfView documentView]];
-        [secondaryPdfView goToPage:page];
-        [[secondaryPdfView documentView] scrollPoint:point];
-        [secondaryPdfView layoutDocumentView];
+        if (page) {
+            point = [secondaryPdfView convertPoint:[secondaryPdfView 
convertPoint:[pdfView convertPoint:point toPage:page] fromPage:page] 
toView:[secondaryPdfView documentView]];
+            [secondaryPdfView goToPage:page];
+            [[secondaryPdfView documentView] scrollPoint:point];
+            [secondaryPdfView layoutDocumentView];
+        }
     }
     
     [[self window] recalculateKeyViewLoop];


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 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to