Revision: 14432
          http://sourceforge.net/p/skim-app/code/14432
Author:   hofman
Date:     2024-08-20 16:45:56 +0000 (Tue, 20 Aug 2024)
Log Message:
-----------
Stick pacer to end of page by number of reading bar lines

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

Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h   2024-08-20 16:22:35 UTC (rev 14431)
+++ trunk/SKPDFView.h   2024-08-20 16:45:56 UTC (rev 14432)
@@ -150,6 +150,7 @@
     NSTimer *pacerTimer;
     CGFloat pacerSpeed;
     CGFloat pacerWaitTime;
+    NSInteger pacerCounter;
     
     SKTransitionController *transitionController;
     

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2024-08-20 16:22:35 UTC (rev 14431)
+++ trunk/SKPDFView.m   2024-08-20 16:45:56 UTC (rev 14432)
@@ -1150,7 +1150,12 @@
 }
 
 - (void)pacerMoveReadingBar {
-    [readingBar goToNextLine];
+    if ([readingBar numberOfLines] > 1 && [readingBar currentLine] >= 
[readingBar maxLine] && pacerCounter + 1 < (NSInteger)[readingBar 
countOfLines]) {
+        ++pacerCounter;
+    } else {
+        pacerCounter = 0;
+        [readingBar goToNextLine];
+    }
 }
 
 - (void)togglePacer {
@@ -1161,6 +1166,7 @@
         __weak SKPDFView *weakSelf = self;
         void (^block)(NSTimer *) = nil;
         if ([self hasReadingBar]) {
+            pacerCounter = 0;
             interval = PACER_LINE_HEIGHT / pacerSpeed;
             block = ^(NSTimer *timer){ [weakSelf pacerMoveReadingBar]; };
         } else {

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