Revision: 7318 http://skim-app.svn.sourceforge.net/skim-app/?rev=7318&view=rev Author: hofman Date: 2011-07-04 00:03:30 +0000 (Mon, 04 Jul 2011)
Log Message: ----------- use convenience methods from PDFView category Modified Paths: -------------- trunk/SKPDFView.m trunk/SKSecondaryPDFView.m trunk/SKSnapshotPDFView.m Modified: trunk/SKPDFView.m =================================================================== --- trunk/SKPDFView.m 2011-07-03 11:05:28 UTC (rev 7317) +++ trunk/SKPDFView.m 2011-07-04 00:03:30 UTC (rev 7318) @@ -1061,10 +1061,10 @@ if (interactionMode == SKPresentationMode) { // Presentation mode - if ([[[self documentView] enclosingScrollView] hasHorizontalScroller] == NO && + if ([[self scrollView] hasHorizontalScroller] == NO && (eventChar == NSRightArrowFunctionKey) && (modifiers == 0)) { [self goToNextPage:self]; - } else if ([[[self documentView] enclosingScrollView] hasHorizontalScroller] == NO && + } else if ([[self scrollView] hasHorizontalScroller] == NO && (eventChar == NSLeftArrowFunctionKey) && (modifiers == 0)) { [self goToPreviousPage:self]; } else if ((eventChar == 'p') && (modifiers == 0)) { @@ -2482,7 +2482,7 @@ } - (NSRect)visibleContentRect { - NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; + NSView *clipView = [[self scrollView] contentView]; return [clipView convertRect:[clipView visibleRect] toView:self]; } @@ -3988,7 +3988,7 @@ - (void)doMagnifyWithEvent:(NSEvent *)theEvent { NSPoint mouseLoc = [theEvent locationInWindow]; NSEvent *lastMouseEvent = theEvent; - NSScrollView *scrollView = [[self documentView] enclosingScrollView]; + NSScrollView *scrollView = [self scrollView]; NSView *documentView = [scrollView documentView]; NSView *clipView = [scrollView contentView]; NSRect originalBounds = [documentView bounds]; Modified: trunk/SKSecondaryPDFView.m =================================================================== --- trunk/SKSecondaryPDFView.m 2011-07-03 11:05:28 UTC (rev 7317) +++ trunk/SKSecondaryPDFView.m 2011-07-04 00:03:30 UTC (rev 7318) @@ -505,7 +505,7 @@ - (void)setScrollerSize:(NSControlSize)controlSize; { - NSScrollView *scrollView = [[self documentView] enclosingScrollView]; + NSScrollView *scrollView = [self scrollView]; [scrollView setHasHorizontalScroller:YES]; [scrollView setHasVerticalScroller:YES]; [[scrollView horizontalScroller] setControlSize:controlSize]; Modified: trunk/SKSnapshotPDFView.m =================================================================== --- trunk/SKSnapshotPDFView.m 2011-07-03 11:05:28 UTC (rev 7317) +++ trunk/SKSnapshotPDFView.m 2011-07-04 00:03:30 UTC (rev 7318) @@ -182,20 +182,20 @@ - (void)handlePDFViewFrameChangedNotification:(NSNotification *)notification { if ([self autoFits]) { - NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; + NSView *clipView = [[self scrollView] contentView]; NSRect rect = [self convertRect:[clipView visibleRect] fromView:clipView]; BOOL scaleWidth = NSWidth(rect) / NSHeight(rect) < NSWidth(autoFitRect) / NSHeight(autoFitRect); CGFloat factor = scaleWidth ? NSWidth(rect) / NSWidth(autoFitRect) : NSHeight(rect) / NSHeight(autoFitRect); NSRect viewRect = scaleWidth ? NSInsetRect(autoFitRect, 0.0, 0.5 * (NSHeight(autoFitRect) - NSHeight(rect) / factor)) : NSInsetRect(autoFitRect, 0.5 * (NSWidth(autoFitRect) - NSWidth(rect) / factor), 0.0); [super setScaleFactor:factor]; - viewRect = [self convertRect:[self convertRect:viewRect fromPage:autoFitPage] toView:[self documentView]]; + viewRect = [self convertRect:viewRect toDocumentViewFromPage:autoFitPage]; [[self documentView] scrollRectToVisible:viewRect]; } } - (void)resetAutoFitRectIfNeeded { if ([self autoFits]) { - NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; + NSView *clipView = [[self scrollView] contentView]; autoFitPage = [self currentPage]; autoFitRect = [self convertRect:[self convertRect:[clipView visibleRect] fromView:clipView] toPage:autoFitPage]; } @@ -377,7 +377,7 @@ - (void)setScrollerSize:(NSControlSize)controlSize; { - NSScrollView *scrollView = [[self documentView] enclosingScrollView]; + NSScrollView *scrollView = [self scrollView]; [scrollView setHasHorizontalScroller:YES]; [scrollView setHasVerticalScroller:YES]; [[scrollView horizontalScroller] setControlSize:controlSize]; @@ -491,7 +491,7 @@ } // end of mouse-tracking loop if ([self autoFits]) { - NSView *clipView = [[[self documentView] enclosingScrollView] contentView]; + NSView *clipView = [[self scrollView] contentView]; autoFitPage = [self currentPage]; autoFitRect = [self convertRect:[self convertRect:[clipView visibleRect] fromView:clipView] toPage:autoFitPage]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit