mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
fixed bug with mouseout / mouseover events with nodes on the edge of the stage
This commit is contained in:
parent
21981e94eb
commit
0ac84408e9
7
dist/kinetic-core.js
vendored
7
dist/kinetic-core.js
vendored
@ -1285,7 +1285,6 @@ Kinetic.Stage.prototype = {
|
|||||||
else if(!isDragging && this.targetShape && this.targetShape.id === shape.id) {
|
else if(!isDragging && this.targetShape && this.targetShape.id === shape.id) {
|
||||||
this._setTarget(undefined);
|
this._setTarget(undefined);
|
||||||
this.mouseoutShape = shape;
|
this.mouseoutShape = shape;
|
||||||
//shape._handleEvents('onmouseout', evt);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1310,7 +1309,6 @@ Kinetic.Stage.prototype = {
|
|||||||
var oldEl = this.targetShape.eventListeners;
|
var oldEl = this.targetShape.eventListeners;
|
||||||
if(oldEl) {
|
if(oldEl) {
|
||||||
this.mouseoutShape = this.targetShape;
|
this.mouseoutShape = this.targetShape;
|
||||||
//this.targetShape._handleEvents('onmouseout', evt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1384,7 +1382,6 @@ Kinetic.Stage.prototype = {
|
|||||||
if(!shapeDetected && this.mouseoutShape) {
|
if(!shapeDetected && this.mouseoutShape) {
|
||||||
this.mouseoutShape._handleEvents('onmouseout', evt);
|
this.mouseoutShape._handleEvents('onmouseout', evt);
|
||||||
this.mouseoutShape = undefined;
|
this.mouseoutShape = undefined;
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -1423,6 +1420,7 @@ Kinetic.Stage.prototype = {
|
|||||||
var targetShape = that.targetShape;
|
var targetShape = that.targetShape;
|
||||||
if(targetShape) {
|
if(targetShape) {
|
||||||
targetShape._handleEvents('onmouseout', evt);
|
targetShape._handleEvents('onmouseout', evt);
|
||||||
|
that.targetShape = undefined;
|
||||||
}
|
}
|
||||||
that.mousePos = undefined;
|
that.mousePos = undefined;
|
||||||
}, false);
|
}, false);
|
||||||
@ -1435,8 +1433,7 @@ Kinetic.Stage.prototype = {
|
|||||||
|
|
||||||
this.content.addEventListener('touchmove', function(evt) {
|
this.content.addEventListener('touchmove', function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
that._handleStageEvent(evt);
|
that._handleStageEvent(evt);}, false);
|
||||||
}, false);
|
|
||||||
|
|
||||||
this.content.addEventListener('touchend', function(evt) {
|
this.content.addEventListener('touchend', function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -372,7 +372,6 @@ Kinetic.Stage.prototype = {
|
|||||||
else if(!isDragging && this.targetShape && this.targetShape.id === shape.id) {
|
else if(!isDragging && this.targetShape && this.targetShape.id === shape.id) {
|
||||||
this._setTarget(undefined);
|
this._setTarget(undefined);
|
||||||
this.mouseoutShape = shape;
|
this.mouseoutShape = shape;
|
||||||
//shape._handleEvents('onmouseout', evt);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,7 +396,6 @@ Kinetic.Stage.prototype = {
|
|||||||
var oldEl = this.targetShape.eventListeners;
|
var oldEl = this.targetShape.eventListeners;
|
||||||
if(oldEl) {
|
if(oldEl) {
|
||||||
this.mouseoutShape = this.targetShape;
|
this.mouseoutShape = this.targetShape;
|
||||||
//this.targetShape._handleEvents('onmouseout', evt);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -471,7 +469,6 @@ Kinetic.Stage.prototype = {
|
|||||||
if(!shapeDetected && this.mouseoutShape) {
|
if(!shapeDetected && this.mouseoutShape) {
|
||||||
this.mouseoutShape._handleEvents('onmouseout', evt);
|
this.mouseoutShape._handleEvents('onmouseout', evt);
|
||||||
this.mouseoutShape = undefined;
|
this.mouseoutShape = undefined;
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -510,6 +507,7 @@ Kinetic.Stage.prototype = {
|
|||||||
var targetShape = that.targetShape;
|
var targetShape = that.targetShape;
|
||||||
if(targetShape) {
|
if(targetShape) {
|
||||||
targetShape._handleEvents('onmouseout', evt);
|
targetShape._handleEvents('onmouseout', evt);
|
||||||
|
that.targetShape = undefined;
|
||||||
}
|
}
|
||||||
that.mousePos = undefined;
|
that.mousePos = undefined;
|
||||||
}, false);
|
}, false);
|
||||||
@ -522,8 +520,7 @@ Kinetic.Stage.prototype = {
|
|||||||
|
|
||||||
this.content.addEventListener('touchmove', function(evt) {
|
this.content.addEventListener('touchmove', function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
that._handleStageEvent(evt);
|
that._handleStageEvent(evt);}, false);
|
||||||
}, false);
|
|
||||||
|
|
||||||
this.content.addEventListener('touchend', function(evt) {
|
this.content.addEventListener('touchend', function(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user