Revision: 2636
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2636&view=rev
Author:   hofman
Date:     2007-08-09 13:25:11 -0700 (Thu, 09 Aug 2007)

Log Message:
-----------
Shade secondary copies of the selection rect in select tool mode.

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

Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h   2007-08-09 19:22:36 UTC (rev 2635)
+++ trunk/SKPDFView.h   2007-08-09 20:25:11 UTC (rev 2636)
@@ -177,6 +177,7 @@
 
 - (void)handleAnnotationWillChangeNotification:(NSNotification *)notification;
 - (void)handleAnnotationDidChangeNotification:(NSNotification *)notification;
+- (void)handlePageChangedNotification:(NSNotification *)notification;
 - (void)handleWindowWillCloseNotification:(NSNotification *)notification;
 
 - (void)resetHoverRects;

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2007-08-09 19:22:36 UTC (rev 2635)
+++ trunk/SKPDFView.m   2007-08-09 20:25:11 UTC (rev 2636)
@@ -190,6 +190,8 @@
                                                  
name:SKAnnotationWillChangeNotification object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handleAnnotationDidChangeNotification:) 
                                                  
name:SKAnnotationDidChangeNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self 
selector:@selector(handlePageChangedNotification:) 
+                                                 
name:PDFViewPageChangedNotification object:self];
     [[NSUserDefaultsController sharedUserDefaultsController] addObserver:self 
forKeys:
         [NSArray arrayWithObjects:SKReadingBarColorKey, SKReadingBarInvertKey, 
nil]];
 }
@@ -383,6 +385,11 @@
         CGContextAddRect(context, *(CGRect *)&selectionRect);
         CGContextSetFillColor(context, color);
         CGContextEOFillPath(context);
+        if ([pdfPage isEqual:[self currentPage]] == NO) {
+            color[3] = 0.3;
+            CGContextSetFillColor(context, color);
+            CGContextFillRect(context, *(CGRect *)&selectionRect);
+        }
         SKCGContextDrawGrabHandle(context, CGPointMake(NSMinX(selectionRect), 
NSMinY(selectionRect)), radius);
         SKCGContextDrawGrabHandle(context, CGPointMake(NSMinX(selectionRect), 
NSMaxY(selectionRect)), radius);
         SKCGContextDrawGrabHandle(context, CGPointMake(NSMaxX(selectionRect), 
NSMinY(selectionRect)), radius);
@@ -2022,6 +2029,11 @@
     }
 }
 
+- (void)handlePageChangedNotification:(NSNotification *)notification {
+    if ([self toolMode] == SKSelectToolMode && NSIsEmptyRect(selectionRect) == 
NO)
+        [self setNeedsDisplay:YES];
+}
+
 #pragma mark FullScreen navigation and autohide
 
 - (void)handleWindowWillCloseNotification:(NSNotification *)notification {


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
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to