mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 09:50:05 +08:00
some refactoring proposed by pavelpower
This commit is contained in:
@@ -225,7 +225,9 @@
|
||||
},
|
||||
drawHit: function() {
|
||||
var clip = !!this.getClipFunc() && this.nodeType !== 'Stage',
|
||||
dd = Kinetic.DD,
|
||||
n = 0,
|
||||
len = 0,
|
||||
children = [],
|
||||
hitCanvas;
|
||||
|
||||
if(this.shouldDrawHit()) {
|
||||
@@ -233,8 +235,11 @@
|
||||
hitCanvas = this.getLayer().hitCanvas;
|
||||
hitCanvas._clip(this);
|
||||
}
|
||||
var children = this.children, len = children.length;
|
||||
for(var n = 0; n < len; n++) {
|
||||
|
||||
children = this.children;
|
||||
len = children.length;
|
||||
|
||||
for(n = 0; n < len; n++) {
|
||||
children[n].drawHit();
|
||||
}
|
||||
if (clip) {
|
||||
|
@@ -17,8 +17,6 @@
|
||||
Kinetic.Layer.prototype = {
|
||||
_initLayer: function(config) {
|
||||
this.nodeType = 'Layer';
|
||||
this.beforeDrawFunc = undefined;
|
||||
this.afterDrawFunc = undefined;
|
||||
this.canvas = new Kinetic.SceneCanvas();
|
||||
this.canvas.getElement().style.position = 'absolute';
|
||||
this.hitCanvas = new Kinetic.HitCanvas();
|
||||
|
@@ -155,7 +155,7 @@
|
||||
|
||||
// stop DD
|
||||
if(dd && dd.node && dd.node._id === this._id) {
|
||||
node._endDrag();
|
||||
this._endDrag();
|
||||
}
|
||||
|
||||
// stop transition
|
||||
|
Reference in New Issue
Block a user