This commit is contained in:
Лаврёнов Антон
2014-09-23 15:05:30 +08:00
parent b984c26e15
commit 0e2136387c
3 changed files with 22 additions and 22 deletions

View File

@@ -4,7 +4,7 @@
* http://www.kineticjs.com/
* Copyright 2013, Eric Rowell
* Licensed under the MIT or GPL Version 2 licenses.
* Date: 2014-08-27
* Date: 2014-09-23
*
* Copyright (C) 2011 - 2013 by Eric Rowell
*
@@ -6275,7 +6275,7 @@ var Kinetic = {};
};
Kinetic.Animation._runFrames = function() {
var layerHash,
var layerHash = {},
animations = this.animations,
anim, layers, func, n, i, layersLen, layer, key, needRedraw;
/*
@@ -6289,36 +6289,36 @@ var Kinetic = {};
* WARNING: don't cache animations.length because it could change while
* the for loop is running, causing a JS error
*/
for(n = 0; n < animations.length; n++) {
layerHash = {};
anim = animations[n];
layers = anim.layers;
func = anim.func;
anim._updateFrameObject(now());
layersLen = layers.length;
// if animation object has a function, execute it
if (func) {
// allow anim bypassing drawing
needRedraw = (func.call(anim, anim.frame) !== false);
} else {
needRedraw = true;
}
if (needRedraw) {
for (i = 0; i < layersLen; i++) {
layer = layers[i];
if (layer._id !== undefined) {
layerHash[layer._id] = layer;
}
}
}
}
if (needRedraw) {
for (key in layerHash) {
layerHash[key].draw();
}
for (key in layerHash) {
layerHash[key].draw();
}
};
Kinetic.Animation._animationLoop = function() {

6
kinetic.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -197,7 +197,7 @@
};
Kinetic.Animation._runFrames = function() {
var layerHash,
var layerHash = {},
animations = this.animations,
anim, layers, func, n, i, layersLen, layer, key, needRedraw;
/*
@@ -211,36 +211,36 @@
* WARNING: don't cache animations.length because it could change while
* the for loop is running, causing a JS error
*/
for(n = 0; n < animations.length; n++) {
layerHash = {};
anim = animations[n];
layers = anim.layers;
func = anim.func;
anim._updateFrameObject(now());
layersLen = layers.length;
// if animation object has a function, execute it
if (func) {
// allow anim bypassing drawing
needRedraw = (func.call(anim, anim.frame) !== false);
} else {
needRedraw = true;
}
if (needRedraw) {
for (i = 0; i < layersLen; i++) {
layer = layers[i];
if (layer._id !== undefined) {
layerHash[layer._id] = layer;
}
}
}
}
if (needRedraw) {
for (key in layerHash) {
layerHash[key].draw();
}
for (key in layerHash) {
layerHash[key].draw();
}
};
Kinetic.Animation._animationLoop = function() {