mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 18:27:58 +08:00
lots of refactoring, and code hardening. Also fixed bug in which dragend events were being fired before mouseup/touchend events
This commit is contained in:
22
src/Stage.js
22
src/Stage.js
@@ -51,6 +51,22 @@
|
||||
}
|
||||
this.setAttr('container', container);
|
||||
},
|
||||
draw: function() {
|
||||
// clear children layers
|
||||
var children = this.getChildren(),
|
||||
len = children.length,
|
||||
n, layer;
|
||||
|
||||
for(n = 0; n < len; n++) {
|
||||
layer = children[n];
|
||||
if (layer.getClearBeforeDraw()) {
|
||||
layer.getCanvas().clear();
|
||||
layer.getHitCanvas().clear();
|
||||
}
|
||||
}
|
||||
|
||||
Kinetic.Node.prototype.draw.call(this);
|
||||
},
|
||||
/**
|
||||
* draw layer scene graphs
|
||||
* @name draw
|
||||
@@ -396,8 +412,10 @@
|
||||
},
|
||||
_mouseup: function(evt) {
|
||||
this._setUserPosition(evt);
|
||||
var that = this, dd = Kinetic.DD, obj = this.getIntersection(this.getUserPosition());
|
||||
|
||||
var that = this,
|
||||
dd = Kinetic.DD,
|
||||
obj = this.getIntersection(this.getUserPosition());
|
||||
|
||||
if(obj && obj.shape) {
|
||||
var shape = obj.shape;
|
||||
shape._handleEvent('mouseup', evt);
|
||||
|
Reference in New Issue
Block a user