Revision: 3620
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3620&view=rev
Author:   hofman
Date:     2008-04-04 11:06:17 -0700 (Fri, 04 Apr 2008)

Log Message:
-----------
Restore some mouseUp: code that should not have been removed.

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-04-04 17:33:59 UTC (rev 3619)
+++ trunk/SKPDFView.m   2008-04-04 18:06:17 UTC (rev 3620)
@@ -1057,6 +1057,24 @@
     switch (toolMode) {
         case SKTextToolMode:
         case SKNoteToolMode:
+            if (mouseDownInAnnotation) {
+                if (nil == activeAnnotation && NSIsEmptyRect(selectionRect) == 
NO) {    
+                     [self setNeedsDisplayInRect:selectionRect];        
+                     selectionRect = NSZeroRect;        
+                     [[NSNotificationCenter defaultCenter] 
postNotificationName:SKPDFViewSelectionChangedNotification object:self];     
+                 } else if ([[activeAnnotation type] 
isEqualToString:SKLinkString]) {   
+                     NSPoint p = [self convertPoint:[theEvent 
locationInWindow] fromView:nil];          
+                     PDFPage *page = [self pageForPoint:p nearest:NO];         
 
+                     if (page && NSPointInRect([self convertPoint:p 
toPage:page], [activeAnnotation bounds]))   
+                         [self editActiveAnnotation:nil];       
+                     else       
+                         [self setActiveAnnotation:nil];        
+                 }      
+                 mouseDownInAnnotation = NO;    
+                 [wasSelection release];        
+                 wasSelection = nil;    
+                 dragMask = 0;          
+            }
             if (toolMode == SKNoteToolMode && hideNotes == NO && [self 
currentSelection] && (annotationMode == SKHighlightNote || annotationMode == 
SKUnderlineNote || annotationMode == SKStrikeOutNote)) {
                 [self addAnnotationWithType:annotationMode];
                 [self setCurrentSelection:nil];
@@ -2840,16 +2858,18 @@
                 [self dragAnnotationWithEvent:theEvent];
                 didDrag = YES;
             }
-            [self setNeedsDisplayForAnnotation:activeAnnotation];
-            mouseDownInAnnotation = NO;
-            [wasSelection release];
-            wasSelection = nil;
+            if (toolMode == SKNoteToolMode && NSEqualSizes(wasBounds.size, 
NSZeroSize) && [[activeAnnotation type] isEqualToString:SKFreeTextString])
+                [self editActiveAnnotation:self];       
             if (didDrag && 
                 [[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableUpdateContentsFromEnclosedTextKey] == NO &&
                 ([[activeAnnotation type] isEqualToString:SKCircleString] || 
[[activeAnnotation type] isEqualToString:SKSquareString])) {
                 NSString *selString = [[[[activeAnnotation page] 
selectionForRect:[activeAnnotation bounds]] string] 
stringByCollapsingWhitespaceAndNewlinesAndRemovingSurroundingWhitespaceAndNewlines];
                 [activeAnnotation setString:selString];
             }
+            [self setNeedsDisplayForAnnotation:activeAnnotation];
+            [wasSelection release];
+            wasSelection = nil;
+            mouseDownInAnnotation = NO;
             dragMask = 0;
             didDrag = NO;
             draggingAnnotation = NO;


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

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to