mirror of
https://github.com/konvajs/konva.git
synced 2025-09-22 20:14:01 +08:00
fix #1018
This commit is contained in:
20
kinetic.js
20
kinetic.js
@@ -4,7 +4,7 @@
|
|||||||
* http://www.kineticjs.com/
|
* http://www.kineticjs.com/
|
||||||
* Copyright 2013, Eric Rowell
|
* Copyright 2013, Eric Rowell
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: 2014-08-27
|
* Date: 2014-09-23
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 - 2013 by Eric Rowell
|
* Copyright (C) 2011 - 2013 by Eric Rowell
|
||||||
*
|
*
|
||||||
@@ -6275,7 +6275,7 @@ var Kinetic = {};
|
|||||||
};
|
};
|
||||||
|
|
||||||
Kinetic.Animation._runFrames = function() {
|
Kinetic.Animation._runFrames = function() {
|
||||||
var layerHash,
|
var layerHash = {},
|
||||||
animations = this.animations,
|
animations = this.animations,
|
||||||
anim, layers, func, n, i, layersLen, layer, key, needRedraw;
|
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
|
* WARNING: don't cache animations.length because it could change while
|
||||||
* the for loop is running, causing a JS error
|
* the for loop is running, causing a JS error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for(n = 0; n < animations.length; n++) {
|
for(n = 0; n < animations.length; n++) {
|
||||||
layerHash = {};
|
|
||||||
anim = animations[n];
|
anim = animations[n];
|
||||||
layers = anim.layers;
|
layers = anim.layers;
|
||||||
func = anim.func;
|
func = anim.func;
|
||||||
|
|
||||||
|
|
||||||
anim._updateFrameObject(now());
|
anim._updateFrameObject(now());
|
||||||
layersLen = layers.length;
|
layersLen = layers.length;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if animation object has a function, execute it
|
// if animation object has a function, execute it
|
||||||
if (func) {
|
if (func) {
|
||||||
// allow anim bypassing drawing
|
// allow anim bypassing drawing
|
||||||
needRedraw = (func.call(anim, anim.frame) !== false);
|
needRedraw = (func.call(anim, anim.frame) !== false);
|
||||||
|
} else {
|
||||||
|
needRedraw = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needRedraw) {
|
if (needRedraw) {
|
||||||
for (i = 0; i < layersLen; i++) {
|
for (i = 0; i < layersLen; i++) {
|
||||||
layer = layers[i];
|
layer = layers[i];
|
||||||
|
|
||||||
if (layer._id !== undefined) {
|
if (layer._id !== undefined) {
|
||||||
layerHash[layer._id] = layer;
|
layerHash[layer._id] = layer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (needRedraw) {
|
|
||||||
for (key in layerHash) {
|
for (key in layerHash) {
|
||||||
layerHash[key].draw();
|
layerHash[key].draw();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Kinetic.Animation._animationLoop = function() {
|
Kinetic.Animation._animationLoop = function() {
|
||||||
|
6
kinetic.min.js
vendored
6
kinetic.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -197,7 +197,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
Kinetic.Animation._runFrames = function() {
|
Kinetic.Animation._runFrames = function() {
|
||||||
var layerHash,
|
var layerHash = {},
|
||||||
animations = this.animations,
|
animations = this.animations,
|
||||||
anim, layers, func, n, i, layersLen, layer, key, needRedraw;
|
anim, layers, func, n, i, layersLen, layer, key, needRedraw;
|
||||||
/*
|
/*
|
||||||
@@ -211,36 +211,36 @@
|
|||||||
* WARNING: don't cache animations.length because it could change while
|
* WARNING: don't cache animations.length because it could change while
|
||||||
* the for loop is running, causing a JS error
|
* the for loop is running, causing a JS error
|
||||||
*/
|
*/
|
||||||
|
|
||||||
for(n = 0; n < animations.length; n++) {
|
for(n = 0; n < animations.length; n++) {
|
||||||
layerHash = {};
|
|
||||||
anim = animations[n];
|
anim = animations[n];
|
||||||
layers = anim.layers;
|
layers = anim.layers;
|
||||||
func = anim.func;
|
func = anim.func;
|
||||||
|
|
||||||
|
|
||||||
anim._updateFrameObject(now());
|
anim._updateFrameObject(now());
|
||||||
layersLen = layers.length;
|
layersLen = layers.length;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// if animation object has a function, execute it
|
// if animation object has a function, execute it
|
||||||
if (func) {
|
if (func) {
|
||||||
// allow anim bypassing drawing
|
// allow anim bypassing drawing
|
||||||
needRedraw = (func.call(anim, anim.frame) !== false);
|
needRedraw = (func.call(anim, anim.frame) !== false);
|
||||||
|
} else {
|
||||||
|
needRedraw = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (needRedraw) {
|
if (needRedraw) {
|
||||||
for (i = 0; i < layersLen; i++) {
|
for (i = 0; i < layersLen; i++) {
|
||||||
layer = layers[i];
|
layer = layers[i];
|
||||||
|
|
||||||
if (layer._id !== undefined) {
|
if (layer._id !== undefined) {
|
||||||
layerHash[layer._id] = layer;
|
layerHash[layer._id] = layer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (needRedraw) {
|
|
||||||
for (key in layerHash) {
|
for (key in layerHash) {
|
||||||
layerHash[key].draw();
|
layerHash[key].draw();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Kinetic.Animation._animationLoop = function() {
|
Kinetic.Animation._animationLoop = function() {
|
||||||
|
Reference in New Issue
Block a user