Revision: 3021
http://skim-app.svn.sourceforge.net/skim-app/?rev=3021&view=rev
Author: hofman
Date: 2007-10-06 12:21:43 -0700 (Sat, 06 Oct 2007)
Log Message:
-----------
Only redisplay reading bar where it is needed.
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2007-10-06 17:53:28 UTC (rev 3020)
+++ trunk/SKPDFView.m 2007-10-06 19:21:43 UTC (rev 3021)
@@ -2686,6 +2686,7 @@
- (void)moveReadingBarForKey:(unichar)eventChar {
BOOL moved = NO;
NSMutableDictionary *userInfo = [NSMutableDictionary
dictionaryWithObjectsAndKeys:[readingBar page], @"oldPage", nil];
+ [self setNeedsDisplayInRect:[readingBar currentBoundsForBox:[self
displayBox]] ofPage:[readingBar page]];
if (eventChar == NSDownArrowFunctionKey)
moved = [readingBar goToNextLine];
else if (eventChar == NSUpArrowFunctionKey)
@@ -2696,7 +2697,7 @@
moved = [readingBar goToPreviousPage];
if (moved) {
[self scrollRect:NSInsetRect([readingBar currentBounds], 0.0, -20.0)
inPageToVisible:[readingBar page]];
- [self setNeedsDisplay:YES];
+ [self setNeedsDisplayInRect:[readingBar currentBoundsForBox:[self
displayBox]] ofPage:[readingBar page]];
[userInfo setObject:[readingBar page] forKey:@"newPage"];
[[NSNotificationCenter defaultCenter]
postNotificationName:SKPDFViewReadingBarDidChangeNotification object:self
userInfo:userInfo];
}
@@ -2709,8 +2710,9 @@
else if (eventChar == NSUpArrowFunctionKey)
numberOfLines--;
if (numberOfLines > 0) {
+ [self setNeedsDisplayInRect:[readingBar currentBoundsForBox:[self
displayBox]] ofPage:[readingBar page]];
[readingBar setNumberOfLines:numberOfLines];
- [self setNeedsDisplay:YES];
+ [self setNeedsDisplayInRect:[readingBar currentBoundsForBox:[self
displayBox]] ofPage:[readingBar page]];
[[NSNotificationCenter defaultCenter]
postNotificationName:SKPDFViewReadingBarDidChangeNotification object:self
userInfo:[NSDictionary dictionaryWithObjectsAndKeys:[readingBar
page], @"oldPage", [readingBar page], @"newPage", nil]];
}
@@ -3320,9 +3322,10 @@
if ([page isEqual:[readingBar page]] == NO || currentLine !=
[readingBar currentLine]) {
[userInfo setObject:[readingBar page] forKey:@"oldPage"];
+ [self setNeedsDisplayInRect:[readingBar currentBoundsForBox:[self
displayBox]] ofPage:[readingBar page]];
[readingBar setPage:currentPage];
[readingBar setCurrentLine:currentLine];
- [self setNeedsDisplay:YES];
+ [self setNeedsDisplayInRect:[readingBar currentBoundsForBox:[self
displayBox]] ofPage:[readingBar page]];
[userInfo setObject:[readingBar page] forKey:@"newPage"];
[[NSNotificationCenter defaultCenter]
postNotificationName:SKPDFViewReadingBarDidChangeNotification object:self
userInfo:userInfo];
lastMouseLoc = mouseLocInDocument;
@@ -3357,7 +3360,9 @@
int numberOfLines = MAX(0, SKIndexOfRectAtYInOrderedRects(mouseLoc.y,
lineBounds, YES)) - firstLine + 1;
if (numberOfLines > 0 && numberOfLines != (int)[readingBar
numberOfLines]) {
+ [self setNeedsDisplayInRect:[readingBar currentBoundsForBox:[self
displayBox]] ofPage:[readingBar page]];
[readingBar setNumberOfLines:numberOfLines];
+ [self setNeedsDisplayInRect:[readingBar currentBoundsForBox:[self
displayBox]] ofPage:[readingBar page]];
[self setNeedsDisplay:YES];
[[NSNotificationCenter defaultCenter]
postNotificationName:SKPDFViewReadingBarDidChangeNotification object:self
userInfo:userInfo];
}
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: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit