Revision: 3861
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3861&view=rev
Author:   hofman
Date:     2008-05-08 10:19:20 -0700 (Thu, 08 May 2008)

Log Message:
-----------
Set hover rects on documentview, so they move when it is scrolled.

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-05-07 15:11:45 UTC (rev 3860)
+++ trunk/SKPDFView.m   2008-05-08 17:19:20 UTC (rev 3861)
@@ -285,18 +285,6 @@
     [super dealloc];
 }
 
-// this is not called on Leopard
-- (void)resetCursorRects {
-       [super resetCursorRects];
-    [self resetHoverRects];
-}
-
-// this is a private method not defined on Tiger
-- (void)addTooltipsForVisiblePages {
-       [super addTooltipsForVisiblePages];
-    [self resetHoverRects];
-}
-
 #pragma mark Hover-rects
 
 // Fix a bug in Tiger's PDFKit, tooltips lead to a crash when you reload a 
PDFDocument in a PDFView
@@ -306,7 +294,7 @@
 - (void)removeHoverRects {
     CFIndex idx = CFArrayGetCount(hoverRects);
     while (idx--)
-        [self 
removeTrackingRect:(NSTrackingRectTag)CFArrayGetValueAtIndex(hoverRects, idx)];
+        [[self documentView] 
removeTrackingRect:(NSTrackingRectTag)CFArrayGetValueAtIndex(hoverRects, idx)];
     CFArrayRemoveAllValues(hoverRects);
 }
 
@@ -327,7 +315,8 @@
                 if ([[annotation type] isEqualToString:SKNoteString] || 
[[annotation type] isEqualToString:SKLinkString]) {
                     NSRect rect = NSIntersectionRect([self 
convertRect:[annotation bounds] fromPage:page], visibleRect);
                     if (NSIsEmptyRect(rect) == NO) {
-                        NSTrackingRectTag tag = [self addTrackingRect:rect 
owner:self userData:annotation assumeInside:NO];
+                        rect = [self convertRect:rect toView:[self 
documentView]];
+                        NSTrackingRectTag tag = [[self documentView] 
addTrackingRect:rect owner:self userData:annotation assumeInside:NO];
                         CFArrayAppendValue(hoverRects, (void *)tag);
                     }
                 }


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 the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to