Revision: 15772
          http://sourceforge.net/p/skim-app/code/15772
Author:   hofman
Date:     2025-11-08 17:07:13 +0000 (Sat, 08 Nov 2025)
Log Message:
-----------
use enum value instead of 0

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

Modified: trunk/PDFAnnotationLine_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationLine_SKExtensions.m      2025-11-08 16:30:51 UTC (rev 
15771)
+++ trunk/PDFAnnotationLine_SKExtensions.m      2025-11-08 17:07:13 UTC (rev 
15772)
@@ -151,7 +151,7 @@
 
 - (SKRectEdges)resizeHandleForPoint:(NSPoint)point 
scaleFactor:(CGFloat)scaleFactor {
     if ([self isResizable] == NO)
-        return 0;
+        return SKNoEdgeMask;
     NSSize size = SKMakeSquareSize(8.0 / scaleFactor);
     point = SKSubstractPoints(point, [self bounds].origin);
     if (NSPointInRect(point, SKRectFromCenterAndSize([self endPoint], size)))
@@ -159,7 +159,7 @@
     else if (NSPointInRect(point, SKRectFromCenterAndSize([self startPoint], 
size)))
         return SKMinXEdgeMask;
     else
-        return 0;
+        return SKNoEdgeMask;
 }
 
 - (void)drawSelectionHighlightWithUnitWidth:(CGFloat)unitWidth 
active:(BOOL)active inContext:(CGContextRef)context {

Modified: trunk/PDFAnnotation_SKExtensions.m
===================================================================
--- trunk/PDFAnnotation_SKExtensions.m  2025-11-08 16:30:51 UTC (rev 15771)
+++ trunk/PDFAnnotation_SKExtensions.m  2025-11-08 17:07:13 UTC (rev 15772)
@@ -467,7 +467,7 @@
 }
 
 - (SKRectEdges)resizeHandleForPoint:(NSPoint)point 
scaleFactor:(CGFloat)scaleFactor {
-    return [self isResizable] ? SKResizeHandleForPointFromRect(point, [self 
bounds], 4.0 / scaleFactor) : 0;
+    return [self isResizable] ? SKResizeHandleForPointFromRect(point, [self 
bounds], 4.0 / scaleFactor) : SKNoEdgeMask;
 }
 
 - (void)drawSelectionHighlightWithUnitWidth:(CGFloat)unitWidth 
active:(BOOL)active inContext:(CGContextRef)context {

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2025-11-08 16:30:51 UTC (rev 15771)
+++ trunk/SKPDFView.m   2025-11-08 17:07:13 UTC (rev 15772)
@@ -4046,7 +4046,7 @@
         originalBounds = 
SKRectFromCenterAndSquareSize(SKIntegralPoint(initialPoint), 0.0);
         if (noteType == SKNoteTypeAnchored) {
             [self addAnnotationWithType:SKNoteTypeAnchored selection:nil 
page:page bounds:originalBounds];
-            resizeHandle = 0;
+            resizeHandle = SKNoEdgeMask;
             originalBounds = [[self currentAnnotation] bounds];
         } else if (noteType == SKNoteTypeLine) {
             isLine = YES;
@@ -4069,7 +4069,7 @@
     NSUInteger eventMask = NSEventMaskLeftMouseUp | 
NSEventMaskLeftMouseDragged;
     
     [self 
setCursorForAreaOfInterest:SKAreaOfInterestForResizeHandle(resizeHandle, page)];
-    if (resizeHandle == 0) {
+    if (resizeHandle == SKNoEdgeMask) {
         [[NSCursor closedHandCursor] push];
         [NSEvent startPeriodicEventsAfterDelay:0.1 withPeriod:0.1];
         eventMask |= NSEventMaskPeriodic;
@@ -4090,7 +4090,7 @@
                 draggedAnnotation = YES;
             }
             mousePoint = [theEvent locationInView:self];
-            if (resizeHandle == 0) {
+            if (resizeHandle == SKNoEdgeMask) {
                 lastMouseEvent = theEvent;
                 [[[self scrollView] contentView] autoscroll:lastMouseEvent];
             }
@@ -4099,10 +4099,10 @@
                 continue;
         }
         BOOL shiftDown = ([theEvent modifierFlags] & NSEventModifierFlagShift) 
!= 0;
-        if (resizeHandle == 0)
+        if (resizeHandle == SKNoEdgeMask)
             page = [self pageForPoint:mousePoint nearest:YES];
         NSPoint draggedPoint = SKSubstractPoints([self convertPoint:mousePoint 
toPage:page], initialPoint);
-        if (resizeHandle == 0) {
+        if (resizeHandle == SKNoEdgeMask) {
             [self moveAnnotationToPoint:draggedPoint onPage:page];
         } else if (isLine) {
             [self dragLineAnnotationStartPoint:(resizeHandle & SKMinXEdgeMask) 
!= 0 by:draggedPoint originalStartPoint:originalStartPoint 
originalEndPoint:originalEndPoint shiftDown:shiftDown];
@@ -4129,7 +4129,7 @@
         [[highlightLayerController layer] setNeedsDisplay];
     }
     
-    if (resizeHandle == 0) {
+    if (resizeHandle == SKNoEdgeMask) {
         [NSEvent stopPeriodicEvents];
         [NSCursor pop];
     }
@@ -4415,11 +4415,11 @@
     
     BOOL didSelect = (NO == NSIsEmptyRect(selectionRect));
     
-    SKRectEdges resizeHandle = didSelect ? 
SKResizeHandleForPointFromRect(initialPoint, selectionRect, margin) : 0;
+    SKRectEdges resizeHandle = didSelect ? 
SKResizeHandleForPointFromRect(initialPoint, selectionRect, margin) : 
SKNoEdgeMask;
     
     initialPoint = SKIntegralPoint(initialPoint);
     
-    if (resizeHandle == 0 && (didSelect == NO || NSPointInRect(initialPoint, 
selectionRect) == NO)) {
+    if (resizeHandle == SKNoEdgeMask && (didSelect == NO || 
NSPointInRect(initialPoint, selectionRect) == NO)) {
         selectionRect.origin = initialPoint;
         selectionRect.size = NSZeroSize;
         resizeHandle = SKMaxXEdgeMask | SKMinYEdgeMask;
@@ -4429,7 +4429,7 @@
     
        NSRect initialRect = selectionRect;
     NSRect pageBounds = [page boundsForBox:[self displayBox]];
-    SKRectEdges newEffectiveResizeHandle, effectiveResizeHandle = resizeHandle;
+    SKRectEdges effectiveResizeHandle = resizeHandle;
     
     [self 
setCursorForAreaOfInterest:SKAreaOfInterestForResizeHandle(resizeHandle, page)];
     
@@ -4448,7 +4448,7 @@
         delta = SKSubstractPoints(newPoint, initialPoint);
         
         if (resizeHandle) {
-            newEffectiveResizeHandle = 0;
+            SKRectEdges newEffectiveResizeHandle = SKNoEdgeMask;
             if ((resizeHandle & SKMaxXEdgeMask))
                 newEffectiveResizeHandle |= newPoint.x < NSMinX(initialRect) ? 
SKMinXEdgeMask : SKMaxXEdgeMask;
             else if ((resizeHandle & SKMinXEdgeMask))
@@ -4463,7 +4463,7 @@
             }
         }
         
-        if (resizeHandle == 0) {
+        if (resizeHandle == SKNoEdgeMask) {
             newRect.origin = SKAddPoints(newRect.origin, delta);
         } else if (([theEvent modifierFlags] & NSEventModifierFlagShift)) {
             CGFloat width = NSWidth(newRect);

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