From 1ccec65619a28d27b8167d807ce669166b106e20 Mon Sep 17 00:00:00 2001 From: cacaodev Date: Fri, 30 Jun 2017 12:03:29 +0200 Subject: [PATCH] Add debug information --- AppKit/CoreAnimation/CPAnimationContext.j | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/AppKit/CoreAnimation/CPAnimationContext.j b/AppKit/CoreAnimation/CPAnimationContext.j index 209f910b3..0bf7b07b7 100644 --- a/AppKit/CoreAnimation/CPAnimationContext.j +++ b/AppKit/CoreAnimation/CPAnimationContext.j @@ -218,7 +218,12 @@ var _CPAnimationContextStack = nil, if (_animationsByObject.size == 0) { if (_completionHandlerAgent) + { +#if (DEBUG) + CPLog.debug("No animations are scheduled. Firing completion handler"); +#endif _completionHandlerAgent.fire(); + } } else [self _startAnimations]; @@ -245,7 +250,12 @@ var _CPAnimationContextStack = nil, if (_completionHandlerAgent) { if (n == 0) + { +#if (DEBUG) + CPLog.debug("Animations are not needed. Firing completion handler"); +#endif _completionHandlerAgent.fire(); + } else _completionHandlerAgent.increment(n); } @@ -487,11 +497,14 @@ var _CPAnimationContextStack = nil, @end +var COMPLETION_AGENT_ID = 0; + var CompletionHandlerAgent = function(aCompletionHandler) { this._completionHandler = aCompletionHandler; this.total = 0; this.valid = true; + this.id = COMPLETION_AGENT_ID++; }; CompletionHandlerAgent.prototype.completionHandler = function()