Revision: 12708
          http://sourceforge.net/p/skim-app/code/12708
Author:   hofman
Date:     2022-01-12 15:30:28 +0000 (Wed, 12 Jan 2022)
Log Message:
-----------
Don't check explicitlyfor core image transitions, only check for other types

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

Modified: trunk/SKTransitionController.h
===================================================================
--- trunk/SKTransitionController.h      2022-01-12 10:43:12 UTC (rev 12707)
+++ trunk/SKTransitionController.h      2022-01-12 15:30:28 UTC (rev 12708)
@@ -64,7 +64,6 @@
 + (NSString *)localizedNameForStyle:(SKTransitionStyle)style;
 
 + (BOOL)isCoreGraphicsTransition:(SKTransitionStyle)style;
-+ (BOOL)isCoreImageTransition:(SKTransitionStyle)style;
 
 - (void)animateForRect:(NSRect)rect from:(NSUInteger)fromIndex 
to:(NSUInteger)toIndex change:(NSRect (^)(void))change;
 

Modified: trunk/SKTransitionController.m
===================================================================
--- trunk/SKTransitionController.m      2022-01-12 10:43:12 UTC (rev 12707)
+++ trunk/SKTransitionController.m      2022-01-12 15:30:28 UTC (rev 12708)
@@ -268,8 +268,6 @@
 + (NSString *)localizedNameForStyle:(SKTransitionStyle)style {
     if (style == SKNoTransition) {
         return NSLocalizedString(@"No Transition", @"Transition name");
-    } else if ([self isCoreImageTransition:style]) {
-        return [CIFilter localizedNameForFilterName:[self nameForStyle:style]];
     } else if ([self isCoreGraphicsTransition:style]) {
         static NSArray *localizedCoreGraphicsNames = nil;
         if (localizedCoreGraphicsNames == nil)
@@ -285,7 +283,9 @@
                   NSLocalizedString(@"Warp Switch", @"Transition name"),
                   NSLocalizedString(@"Flip", @"Transition name"), nil];
         return [[localizedCoreGraphicsNames objectAtIndex:style] 
stringByAppendingString:@"*"];
-    };
+    } else {
+        return [CIFilter localizedNameForFilterName:[self nameForStyle:style]];
+    }
     return @"";
 }
 
@@ -293,10 +293,6 @@
     return hasCoreGraphicsTransitions && style > SKNoTransition && style < 
SKCoreImageTransition;
 }
 
-+ (BOOL)isCoreImageTransition:(SKTransitionStyle)style {
-    return style >= SKCoreImageTransition;
-}
-
 - (void)dealloc {
     view = nil;
     SKDESTROY(transitionView);
@@ -474,46 +470,10 @@
         currentTransition = [[[SKTransitionInfo alloc] 
initWithProperties:[pageTransitions objectAtIndex:idx]] autorelease];
     }
     
-    if ([SKTransitionController isCoreImageTransition:[currentTransition 
transitionStyle]]) {
+    if ([currentTransition transitionStyle] == SKNoTransition) {
         
-        animating = YES;
+        change();
         
-        NSWindow *viewWindow = [view window];
-        CIImage *initialImage = [self currentImageForRect:rect scale:NULL];
-        
-        // We don't want the window to draw the next state before the 
animation is run
-        [viewWindow disableFlushWindow];
-        
-        NSRect toRect = change();
-
-        NSRect bounds = [view bounds];
-        CGFloat imageScale = 1.0;
-        CIImage *finalImage = [self currentImageForRect:toRect 
scale:&imageScale];
-        CGRect cgRect = 
CGRectIntegral(scaleRect(NSIntersectionRect(NSUnionRect(rect, toRect), bounds), 
imageScale));
-        CGRect cgBounds = scaleRect(bounds, imageScale);
-        CIFilter *transitionFilter = [self 
transitionFilterForTransition:currentTransition
-                                                                    rect:cgRect
-                                                                  
bounds:cgBounds
-                                                                 
forward:currentForward
-                                                            
initialImage:initialImage
-                                                              
finalImage:finalImage];
-        [self showTransitionViewForRect:bounds image:initialImage 
extent:cgBounds];
-        
-        // Update the view and its window, so it shows the correct state when 
it is shown.
-        [view display];
-        // Remember we disabled flushing in the previous method, we need to 
balance that.
-        [viewWindow enableFlushWindow];
-        [viewWindow flushWindow];
-        
-        [transitionView setFilter:transitionFilter];
-        [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
-                [context setDuration:[currentTransition duration]];
-                [[transitionView animator] setProgress:1.0];
-            } completionHandler:^{
-                [self removeTransitionView];
-                animating = NO;
-            }];
-        
     } else if ([SKTransitionController 
isCoreGraphicsTransition:[currentTransition transitionStyle]]) {
         
         animating = YES;
@@ -579,7 +539,45 @@
         });
         
     } else {
-        change();
+        
+        animating = YES;
+        
+        NSWindow *viewWindow = [view window];
+        CIImage *initialImage = [self currentImageForRect:rect scale:NULL];
+        
+        // We don't want the window to draw the next state before the 
animation is run
+        [viewWindow disableFlushWindow];
+        
+        NSRect toRect = change();
+
+        NSRect bounds = [view bounds];
+        CGFloat imageScale = 1.0;
+        CIImage *finalImage = [self currentImageForRect:toRect 
scale:&imageScale];
+        CGRect cgRect = 
CGRectIntegral(scaleRect(NSIntersectionRect(NSUnionRect(rect, toRect), bounds), 
imageScale));
+        CGRect cgBounds = scaleRect(bounds, imageScale);
+        CIFilter *transitionFilter = [self 
transitionFilterForTransition:currentTransition
+                                                                    rect:cgRect
+                                                                  
bounds:cgBounds
+                                                                 
forward:currentForward
+                                                            
initialImage:initialImage
+                                                              
finalImage:finalImage];
+        [self showTransitionViewForRect:bounds image:initialImage 
extent:cgBounds];
+        
+        // Update the view and its window, so it shows the correct state when 
it is shown.
+        [view display];
+        // Remember we disabled flushing in the previous method, we need to 
balance that.
+        [viewWindow enableFlushWindow];
+        [viewWindow flushWindow];
+        
+        [transitionView setFilter:transitionFilter];
+        [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
+                [context setDuration:[currentTransition duration]];
+                [[transitionView animator] setProgress:1.0];
+            } completionHandler:^{
+                [self removeTransitionView];
+                animating = NO;
+            }];
+        
     }
 }
 

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