Revision: 5415
http://skim-app.svn.sourceforge.net/skim-app/?rev=5415&view=rev
Author: hofman
Date: 2009-06-11 12:51:58 +0000 (Thu, 11 Jun 2009)
Log Message:
-----------
start periodic event durng magnify tool to support continuous auto-scroll
Modified Paths:
--------------
trunk/SKPDFView.m
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2009-06-11 11:02:08 UTC (rev 5414)
+++ trunk/SKPDFView.m 2009-06-11 12:51:58 UTC (rev 5415)
@@ -3872,6 +3872,7 @@
- (void)doMagnifyWithEvent:(NSEvent *)theEvent {
NSPoint mouseLoc = [theEvent locationInWindow];
+ NSEvent *lastMouseEvent = theEvent;
NSScrollView *scrollView = [[self documentView] enclosingScrollView];
NSView *documentView = [scrollView documentView];
NSView *clipView = [scrollView contentView];
@@ -3897,9 +3898,11 @@
[documentView setPostsBoundsChangedNotifications: NO];
[[self window] discardCachedImage]; // make sure not to use the cached
image
+
+ [NSEvent startPeriodicEventsAfterDelay:0.1 withPeriod:0.1];
+
+ while ([theEvent type] != NSLeftMouseUp) {
- while ([theEvent type] != NSLeftMouseUp) {
-
if ([theEvent type] == NSLeftMouseDown || [theEvent type] ==
NSFlagsChanged) {
// set up the currentLevel and magnification
NSUInteger modifierFlags = [theEvent modifierFlags];
@@ -3917,6 +3920,7 @@
} else if ([theEvent type] == NSLeftMouseDragged) {
// get Mouse location and check if it is with the view's rect
mouseLoc = [theEvent locationInWindow];
+ lastMouseEvent = theEvent;
}
if ([self mouse:mouseLoc inRect:visibleRect]) {
@@ -3978,16 +3982,18 @@
[[self window] enableFlushWindow];
[[self window] flushWindowIfNeeded];
}
- if ([theEvent type] == NSLeftMouseDragged)
- [documentView autoscroll:theEvent];
+ if ([theEvent type] == NSLeftMouseDragged || [theEvent type] ==
NSPeriodic)
+ [documentView autoscroll:lastMouseEvent];
if (currentLevel > 2)
[[self window] cacheImageInRect:visibleRect];
else
[[self window] discardCachedImage];
}
- theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask | NSFlagsChangedMask];
+ theEvent = [[self window] nextEventMatchingMask: NSLeftMouseUpMask |
NSLeftMouseDraggedMask | NSFlagsChangedMask | NSPeriodicMask];
}
+ [NSEvent stopPeriodicEvents];
+
magnification = 0.0;
[[NSNotificationCenter defaultCenter]
postNotificationName:SKPDFViewMagnificationChangedNotification object:self];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit