Revision: 15967
          http://sourceforge.net/p/skim-app/code/15967
Author:   hofman
Date:     2026-01-06 18:44:46 +0000 (Tue, 06 Jan 2026)
Log Message:
-----------
change variable use

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2026-01-06 18:22:45 UTC (rev 15966)
+++ trunk/SKPDFView.m   2026-01-06 18:44:46 UTC (rev 15967)
@@ -4532,16 +4532,15 @@
     PDFPage *readingBarPage = [readingBar page];
     PDFPage *page = readingBarPage;
     NSInteger numberOfLines = [[page lineRects] count];
+    NSView *docView = [self documentView];NSLog(@"%i", docView.flipped);
     NSEvent *lastMouseEvent = theEvent;
-    NSPoint lastMouseLoc = [self convertPoint:[theEvent locationInWindow] 
fromView:nil];
-    NSPoint point = [self convertPoint:lastMouseLoc toPage:page];
-    NSInteger lineOffset = [page indexOfLineRectAtPoint:point lower:YES] - 
[readingBar currentLine];
+    NSPoint mouseLoc = [self convertPoint:[theEvent locationInWindow] 
fromView:nil];
+    NSPoint mouseLocInPage = [self convertPoint:mouseLoc toPage:page];
+    NSInteger lineOffset = [page indexOfLineRectAtPoint:mouseLocInPage 
lower:YES] - [readingBar currentLine];
+    CGFloat lastY = [self convertPoint:mouseLoc toView:docView].y;
     NSDate *lastPageChangeDate = [NSDate distantPast];
     BOOL isDoubleClick = [theEvent clickCount] == 2;
-    NSView *docView = [self documentView];
     
-    lastMouseLoc = [self convertPoint:lastMouseLoc toView:docView];
-    
     [[NSCursor closedHandBarCursor] push];
     
     [NSEvent startPeriodicEventsAfterDelay:0.1 withPeriod:0.1];
@@ -4558,7 +4557,7 @@
         }
         
         // dragging
-        NSPoint mouseLoc = [self convertPoint:[lastMouseEvent 
locationInWindow] fromView:nil];
+        mouseLoc = [self convertPoint:[lastMouseEvent locationInWindow] 
fromView:nil];
         if ([docView autoscroll:lastMouseEvent] == NO &&
             ([self displayMode] & kPDFDisplaySinglePageContinuous) == 0 &&
             [[NSDate date] timeIntervalSinceDate:lastPageChangeDate] > 0.7) {
@@ -4565,13 +4564,13 @@
             if (mouseLoc.y < NSMinY([self bounds])) {
                 if ([self canGoToNextPage]) {
                     [self goToNextPage:self];
-                    lastMouseLoc.y = NSMaxY([docView bounds]);
+                    lastY = NSMaxY([docView bounds]);
                     lastPageChangeDate = [NSDate date];
                 }
             } else if (mouseLoc.y > NSMaxY([self bounds])) {
                 if ([self canGoToPreviousPage]) {
                     [self goToPreviousPage:self];
-                    lastMouseLoc.y = NSMinY([docView bounds]);
+                    lastY = NSMinY([docView bounds]);
                     lastPageChangeDate = [NSDate date];
                 }
             }
@@ -4584,15 +4583,15 @@
         }
         
         if (numberOfLines > 0) {
-            NSPoint mouseLocInPage = [self convertPoint:mouseLoc 
toPage:mousePage];
-            NSPoint mouseLocInDocument = [self convertPoint:mouseLoc 
toView:docView];
-            NSInteger currentLine = [page 
indexOfLineRectAtPoint:mouseLocInPage lower:mouseLocInDocument.y < 
lastMouseLoc.y] - lineOffset;
+            mouseLocInPage = [self convertPoint:mouseLoc toPage:mousePage];
+            CGFloat y = [self convertPoint:mouseLoc toView:docView].y;
+            NSInteger currentLine = [page 
indexOfLineRectAtPoint:mouseLocInPage lower:y < lastY] - lineOffset;
             currentLine = MAX(0, MIN(numberOfLines - (NSInteger)[readingBar 
numberOfLines], currentLine));
             
             if ([page isEqual:readingBarPage] == NO || currentLine != 
[readingBar currentLine]) {
                 [readingBar goToLine:currentLine onPage:page];
                 readingBarPage = page;
-                lastMouseLoc = mouseLocInDocument;
+                lastY = y;
             }
         }
     }

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