diff --git a/AppKit/CoreAnimation/CPAnimationContext.j b/AppKit/CoreAnimation/CPAnimationContext.j index a7a8aa90c..c5af6f456 100644 --- a/AppKit/CoreAnimation/CPAnimationContext.j +++ b/AppKit/CoreAnimation/CPAnimationContext.j @@ -147,15 +147,13 @@ var _CPAnimationContextStack = nil, keyTimes, timingFunctions, objectId; + needsPeriodicFrameUpdates, if (!aKeyPath || !anObject || !(animation = [anObject animationForKey:aKeyPath]) || ![animation isKindOfClass:[CAAnimation class]]) return nil; duration = [animation duration] || [self duration]; - - var needsPeriodicFrameUpdates = (((aKeyPath == @"frame" || aKeyPath == @"frameSize") && - ([anObject hasCustomLayoutSubviews] || [anObject hasCustomDrawRect])) || [[anObject animator] wantsPeriodicFrameUpdates]) && - (objectId = [anObject UID]); + needsPeriodicFrameUpdates = [[anObject animator] needsPeriodicFrameUpdatesForKeyPath:aKeyPath]; if (_completionHandlerAgent) _completionHandlerAgent.increment(); @@ -271,7 +269,6 @@ var _CPAnimationContextStack = nil, isFrameKeyPath = (keyPath == @"frame" || keyPath == @"frameSize"), customLayout = [aTargetView hasCustomLayoutSubviews], customDrawing = [aTargetView hasCustomDrawRect], - needsPeriodicFrameUpdates = ((isFrameKeyPath && (customLayout || customDrawing)) || [[aTargetView animator] wantsPeriodicFrameUpdates]); if (needsCSSAnimation) { @@ -305,6 +302,7 @@ var _CPAnimationContextStack = nil, var completionFunction = (anIndex == 0) ? anAction.completion : null; var property = [aDict objectForKey:@"property"], getter = [aDict objectForKey:@"value"]; + needsPeriodicFrameUpdates = [[targetView animator] needsPeriodicFrameUpdatesForKeyPath:keyPath], cssAnimation.addPropertyAnimation(property, getter, duration, anAction.keytimes, anAction.values, timingFunctions, completionFunction); }]; @@ -348,7 +346,8 @@ var _CPAnimationContextStack = nil, }; } - [self getAnimations:cssAnimations getTimers:timers forView:aSubview usingAction:action rootView:rootView cssAnimate:!customLayout]; + var animate = !needsPeriodicFrameUpdates; + [self getAnimations:cssAnimations getTimers:timers usingAction:action cssAnimate:animate]; }]; } } diff --git a/AppKit/CoreAnimation/CPViewAnimator.j b/AppKit/CoreAnimation/CPViewAnimator.j index 5ee2b890d..45dd5470e 100644 --- a/AppKit/CoreAnimation/CPViewAnimator.j +++ b/AppKit/CoreAnimation/CPViewAnimator.j @@ -87,6 +87,14 @@ } } +- (BOOL)needsPeriodicFrameUpdatesForKeyPath:(CPString)aKeyPath +{ + return ((aKeyPath == @"frame" || aKeyPath == @"frameSize") && + (([_target hasCustomLayoutSubviews] && ![_target implementsSelector:@selector(frameRectOfView:inSuperviewSize:)]) + || [_target hasCustomDrawRect])) + || [self wantsPeriodicFrameUpdates]; +} + @end var transformFrameToWidth = function(start, current)