Revision: 5675
          http://skim-app.svn.sourceforge.net/skim-app/?rev=5675&view=rev
Author:   hofman
Date:     2009-09-04 17:29:36 +0000 (Fri, 04 Sep 2009)

Log Message:
-----------
Mouse over an empty page area now returns kPDFPageArea instead of kPDFNoArea, 
so interpret that the same.

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2009-09-04 17:09:14 UTC (rev 5674)
+++ trunk/SKPDFView.m   2009-09-04 17:29:36 UTC (rev 5675)
@@ -1079,12 +1079,12 @@
         PDFPage *page = [self pageForPoint:p nearest:YES];
         p = [self convertPoint:p toPage:page];
         
-        if (readingBar && (area == kPDFNoArea || (toolMode != SKSelectToolMode 
&& toolMode != SKMagnifyToolMode)) && [[readingBar page] isEqual:page] && p.y 
>= NSMinY([readingBar currentBounds]) && p.y <= NSMaxY([readingBar 
currentBounds])) {
+        if (readingBar && (area == kPDFNoArea || area == kPDFPageArea || 
(toolMode != SKSelectToolMode && toolMode != SKMagnifyToolMode)) && 
[[readingBar page] isEqual:page] && p.y >= NSMinY([readingBar currentBounds]) 
&& p.y <= NSMaxY([readingBar currentBounds])) {
             if (p.y < NSMinY([readingBar currentBounds]) + 3.0)
                 [self doResizeReadingBarWithEvent:theEvent];
             else
                 [self doDragReadingBarWithEvent:theEvent];
-        } else if (area == kPDFNoArea) {
+        } else if (area == kPDFNoArea || area == kPDFPageArea) {
             [self doDragWithEvent:theEvent];
         } else {
             
@@ -4156,19 +4156,19 @@
         else
             cursor = [NSCursor arrowCursor];
     } else {
+        PDFAreaOfInterest area = [self areaOfInterestForMouse:theEvent];
         switch (toolMode) {
             case SKTextToolMode:
             case SKNoteToolMode:
             {
                 PDFPage *page = [self pageForPoint:p nearest:NO];
                 p = [self convertPoint:p toPage:page];
-                PDFAreaOfInterest area = [self 
areaOfInterestForMouse:theEvent];
                 if ([activeAnnotation isResizable] && [[activeAnnotation page] 
isEqual:page] && [activeAnnotation hitTest:p])
                     area = kPDFAnnotationArea;
-                BOOL canSelectOrDrag = area == kPDFNoArea || toolMode == 
SKTextToolMode || hideNotes || annotationMode == SKHighlightNote || 
annotationMode == SKUnderlineNote || annotationMode == SKStrikeOutNote;
+                BOOL canSelectOrDrag = area == kPDFNoArea || area == 
kPDFPageArea || toolMode == SKTextToolMode || hideNotes || annotationMode == 
SKHighlightNote || annotationMode == SKUnderlineNote || annotationMode == 
SKStrikeOutNote;
                 if (readingBar && [[readingBar page] isEqual:page] && 
NSPointInRect(p, [readingBar currentBoundsForBox:[self displayBox]]))
                     cursor = p.y < NSMinY([readingBar currentBounds]) + 3.0 ? 
[NSCursor resizeUpDownCursor] : [NSCursor openHandCursor];
-                else if (area == kPDFNoArea || (canSelectOrDrag && area == 
kPDFPageArea && [theEvent standardModifierFlags] == 0 && [[page 
selectionForRect:NSMakeRect(p.x - 40.0, p.y - 50.0, 80.0, 100.0)] string] == 
nil))
+                else if (area == kPDFNoArea || area == kPDFPageArea || 
(canSelectOrDrag && area == kPDFPageArea && [theEvent standardModifierFlags] == 
0 && [[page selectionForRect:NSMakeRect(p.x - 40.0, p.y - 50.0, 80.0, 100.0)] 
string] == nil))
                     cursor = [NSCursor openHandCursor];
                 else if (toolMode == SKNoteToolMode && annotationMode != 
SKHighlightNote && annotationMode != SKUnderlineNote && annotationMode != 
SKStrikeOutNote)
                     cursor = [NSCursor arrowCursor];
@@ -4181,7 +4181,7 @@
                     cursor = [NSCursor openHandCursor];
                 break;
             case SKSelectToolMode:
-                if ([self areaOfInterestForMouse:theEvent] == kPDFNoArea) {
+                if (area == kPDFNoArea || area == kPDFPageArea) {
                     cursor = [NSCursor openHandCursor];
                 } else {
                     CGFloat margin = 4.0 / [self scaleFactor];
@@ -4224,10 +4224,10 @@
                             }
                         }
                     }
-                }
                 break;
+            }
             case SKMagnifyToolMode:
-                if ([self areaOfInterestForMouse:theEvent] == kPDFNoArea)
+                if (area == kPDFNoArea || area == kPDFPageArea)
                     cursor = [NSCursor openHandCursor];
                 else
                     cursor = ([theEvent modifierFlags] & NSShiftKeyMask) ? 
[NSCursor zoomOutCursor] : [NSCursor zoomInCursor];


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to