Revision: 7087
http://skim-app.svn.sourceforge.net/skim-app/?rev=7087&view=rev
Author: hofman
Date: 2011-02-04 21:54:18 +0000 (Fri, 04 Feb 2011)
Log Message:
-----------
scroll page in continuous mode after fitting window
Modified Paths:
--------------
trunk/SKMainWindowController_Actions.m
Modified: trunk/SKMainWindowController_Actions.m
===================================================================
--- trunk/SKMainWindowController_Actions.m 2011-02-04 21:54:03 UTC (rev
7086)
+++ trunk/SKMainWindowController_Actions.m 2011-02-04 21:54:18 UTC (rev
7087)
@@ -758,7 +758,7 @@
return;
}
- PDFDisplayMode displayMode = [pdfView displayMode];
+ PDFDisplayMode displayMode = [[self pdfView] displayMode];
CGFloat scaleFactor = [[self pdfView] scaleFactor];
BOOL autoScales = [[self pdfView] autoScales];
BOOL isSingleRow;
@@ -773,6 +773,8 @@
NSRect frame = [[self window] frame];
NSSize size, oldSize = [[self pdfView] frame].size;
NSRect documentRect = [[[self pdfView] documentView] convertRect:[[[self
pdfView] documentView] bounds] toView:nil];
+ PDFPage *page = [[self pdfView] currentPage];
+ PDFDisplayBox box = [[self pdfView] displayBox];
// Calculate the new size for the pdfView
size.width = NSWidth(documentRect);
@@ -781,7 +783,7 @@
if (isSingleRow) {
size.height = NSHeight(documentRect);
} else {
- size.height = NSHeight([[self pdfView] convertRect:[[[self pdfView]
currentPage] boundsForBox:[[self pdfView] displayBox]] fromPage:[[self pdfView]
currentPage]]);
+ size.height = NSHeight([[self pdfView] convertRect:[page
boundsForBox:box] fromPage:page]);
if ([[self pdfView] displaysPageBreaks])
size.height += 8.0 * scaleFactor;
size.width += [NSScroller scrollerWidth];
@@ -798,6 +800,9 @@
frame = [[self window] constrainFrameRect:frame toScreen:[[self window]
screen] ?: [NSScreen mainScreen]];
[[self window] setFrame:frame display:[[self window] isVisible]];
+
+ if (displayMode == kPDFDisplaySinglePageContinuous || displayMode ==
kPDFDisplayTwoUpContinuous)
+ [[self pdfView] goToRect:[page boundsForBox:box] onPage:page];
}
- (void)passwordSheetDidEnd:(SKPasswordSheetController *)controller
returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit