Revision: 14369
          http://sourceforge.net/p/skim-app/code/14369
Author:   hofman
Date:     2024-07-10 09:35:42 +0000 (Wed, 10 Jul 2024)
Log Message:
-----------
use local variable for note type

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2024-07-10 09:32:45 UTC (rev 14368)
+++ trunk/SKPDFView.m   2024-07-10 09:35:42 UTC (rev 14369)
@@ -4205,6 +4205,7 @@
     BOOL isLine = [currentAnnotation isLine];
     NSPoint pagePoint = NSZeroPoint;
     PDFPage *page = [self pageAndPoint:&pagePoint forEvent:theEvent 
nearest:YES];
+    SKNoteType noteType = annotationMode;
     BOOL shouldAddAnnotation = currentAnnotation == nil;
     NSPoint originalStartPoint = NSZeroPoint;
     NSPoint originalEndPoint = NSZeroPoint;
@@ -4219,12 +4220,12 @@
         [self setNeedsDisplayForAnnotation:currentAnnotation];
     
     if (shouldAddAnnotation) {
-        if (annotationMode == SKAnchoredNote) {
+        if (noteType == SKAnchoredNote) {
             [self addAnnotationWithType:SKAnchoredNote selection:nil page:page 
bounds:SKRectFromCenterAndSquareSize(SKIntegralPoint(pagePoint), 0.0)];
             originalBounds = [[self currentAnnotation] bounds];
         } else {
             originalBounds = 
SKRectFromCenterAndSquareSize(SKIntegralPoint(pagePoint), 0.0);
-            if (annotationMode == SKLineNote) {
+            if (noteType == SKLineNote) {
                 isLine = YES;
                 resizeHandle = SKMaxXEdgeMask;
                 originalStartPoint = originalEndPoint = originalBounds.origin;
@@ -4259,7 +4260,7 @@
             break;
         } else if ([theEvent type] == NSEventTypeLeftMouseDragged) {
             if (currentAnnotation == nil) {
-                [self addAnnotationWithType:annotationMode selection:nil 
page:page bounds:SKRectFromCenterAndSquareSize(originalBounds.origin, 0.0)];
+                [self addAnnotationWithType:noteType selection:nil page:page 
bounds:SKRectFromCenterAndSquareSize(originalBounds.origin, 0.0)];
             }
             lastMouseEvent = theEvent;
             draggedAnnotation = YES;
@@ -4285,7 +4286,7 @@
         if (draggedAnnotation)
             [currentAnnotation autoUpdateString];
         
-        if (shouldAddAnnotation && toolMode == SKNoteToolMode && 
(annotationMode == SKAnchoredNote || annotationMode == SKFreeTextNote))
+        if (shouldAddAnnotation && toolMode == SKNoteToolMode && (noteType == 
SKAnchoredNote || noteType == SKFreeTextNote))
             [self editCurrentAnnotation:self];          
         
         atomic_store(&highlightLayerState, SKLayerRemove);

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to