From fca2746a8208bc2f034a17e74f1d4cd456170dc9 Mon Sep 17 00:00:00 2001 From: cacaodev Date: Fri, 6 May 2016 18:19:52 +0200 Subject: [PATCH] Fixed: custom layout and custom drawing was not animated The bug was appearing with the following conditions: keypath : frame , frameSize browsers : Google Chrome, Firefox --- AppKit/CoreAnimation/CPAnimationContext.j | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/AppKit/CoreAnimation/CPAnimationContext.j b/AppKit/CoreAnimation/CPAnimationContext.j index 797a7cfdf..1bbdcfc5a 100644 --- a/AppKit/CoreAnimation/CPAnimationContext.j +++ b/AppKit/CoreAnimation/CPAnimationContext.j @@ -617,20 +617,21 @@ var FrameUpdater = function(anIdentifier) this._stop = false; this._targets = []; this._callbacks = []; + var frameUpdater = this; this._updateFunction = function(timestamp) { + if (frameUpdater._startDate == null) + frameUpdater._startDate = timestamp; + if (frameUpdater._stop) return; - if (this._startDate == null) - this._startDate = timestamp; - for (var i = 0; i < frameUpdater._callbacks.length; i++) frameUpdater._callbacks[i](); - if (timestamp - this._startDate < frameUpdater._duration * 1000) + if (timestamp - frameUpdater._startDate < frameUpdater._duration * 1000) window.requestAnimationFrame(frameUpdater._updateFunction); }; };