mirror of
https://github.com/konvajs/konva.git
synced 2025-09-23 04:36:47 +08:00
the Sprite afterFrame function should only execute once
This commit is contained in:
2
dist/kinetic-core.js
vendored
2
dist/kinetic-core.js
vendored
@@ -5391,6 +5391,8 @@ Kinetic.Sprite.prototype = {
|
|||||||
that._updateIndex();
|
that._updateIndex();
|
||||||
if(that.afterFrameFunc && index === that.afterFrameIndex) {
|
if(that.afterFrameFunc && index === that.afterFrameIndex) {
|
||||||
that.afterFrameFunc();
|
that.afterFrameFunc();
|
||||||
|
delete that.afterFrameFunc;
|
||||||
|
delete that.afterFrameIndex;
|
||||||
}
|
}
|
||||||
}, 1000 / this.attrs.frameRate);
|
}, 1000 / this.attrs.frameRate);
|
||||||
|
|
||||||
|
2
dist/kinetic-core.min.js
vendored
2
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -70,6 +70,8 @@ Kinetic.Sprite.prototype = {
|
|||||||
that._updateIndex();
|
that._updateIndex();
|
||||||
if(that.afterFrameFunc && index === that.afterFrameIndex) {
|
if(that.afterFrameFunc && index === that.afterFrameIndex) {
|
||||||
that.afterFrameFunc();
|
that.afterFrameFunc();
|
||||||
|
delete that.afterFrameFunc;
|
||||||
|
delete that.afterFrameIndex;
|
||||||
}
|
}
|
||||||
}, 1000 / this.attrs.frameRate);
|
}, 1000 / this.attrs.frameRate);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user