Revision: 15186
          http://sourceforge.net/p/skim-app/code/15186
Author:   hofman
Date:     2025-05-11 15:41:28 +0000 (Sun, 11 May 2025)
Log Message:
-----------
combine check for window in animation method

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

Modified: trunk/SKPresentationView.m
===================================================================
--- trunk/SKPresentationView.m  2025-05-11 14:59:46 UTC (rev 15185)
+++ trunk/SKPresentationView.m  2025-05-11 15:41:28 UTC (rev 15186)
@@ -172,8 +172,9 @@
 }
 
 - (BOOL)animateTransitionAtIndex:(NSUInteger)idx forward:(BOOL)forward 
toPage:(PDFPage *)toPage {
-    if ([transitionController pageTransitions] ||
-        ([[transitionController transition] style] != SKNoTransition && 
equalStrings([page label], [toPage label]) == NO)) {
+    if ([self window] &&
+        ([transitionController pageTransitions] ||
+         ([[transitionController transition] style] != SKNoTransition && 
equalStrings([page label], [toPage label]) == NO))) {
         SKTransitionAnimation animation = [transitionController 
animationAtIndex:idx forView:self];
         if (animation) {
             NSRect rect = NSUnionRect([self pageRect:page], [self 
pageRect:toPage]);
@@ -206,7 +207,7 @@
     NSUInteger idx = [page pageIndex];
     if (idx + 1 < [pdfDoc pageCount]) {
         PDFPage *toPage = [pdfDoc pageAtIndex:idx + 1];
-        if ([self window] == nil || NO == [self animateTransitionAtIndex:idx 
forward:YES toPage:toPage])
+        if (NO == [self animateTransitionAtIndex:idx forward:YES 
toPage:toPage])
             [self setPage:toPage];
     }
 }
@@ -216,7 +217,7 @@
     NSUInteger idx = [page pageIndex];
     if (idx > 0) {
         PDFPage *toPage = [pdfDoc pageAtIndex:idx - 1];
-        if ([self window] == nil || NO == [self animateTransitionAtIndex:idx - 
1 forward:NO toPage:toPage])
+        if (NO == [self animateTransitionAtIndex:idx - 1 forward:NO 
toPage:toPage])
             [self setPage:toPage];
     }
 }

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



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to