mirror of
https://github.com/konvajs/konva.git
synced 2025-12-05 03:24:23 +08:00
fixed drawing bug related to new throttle feature
This commit is contained in:
11
src/Layer.js
11
src/Layer.js
@@ -43,6 +43,17 @@ Kinetic.Layer.prototype = {
|
||||
this._draw();
|
||||
this.lastDrawTime = time;
|
||||
}
|
||||
/*
|
||||
* if we cannot draw the layer due to throttling,
|
||||
* try to redraw the layer in the near future
|
||||
*/
|
||||
else if(this.drawTimeout === undefined) {
|
||||
var that = this;
|
||||
this.drawTimeout = setTimeout(function() {
|
||||
that.draw();
|
||||
clearTimeout(that.drawTimeout);
|
||||
}, 5);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* set throttle
|
||||
|
||||
Reference in New Issue
Block a user