mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 18:27:58 +08:00
fixed drag and drop regression bug
This commit is contained in:
@@ -93,7 +93,7 @@
|
|||||||
ap = this.getAbsolutePosition(),
|
ap = this.getAbsolutePosition(),
|
||||||
animNode = layer || this;
|
animNode = layer || this;
|
||||||
|
|
||||||
if(pos) {
|
if(pos && !dd.node) {
|
||||||
dd.node = this;
|
dd.node = this;
|
||||||
dd.offset.x = pos.x - ap.x;
|
dd.offset.x = pos.x - ap.x;
|
||||||
dd.offset.y = pos.y - ap.y;
|
dd.offset.y = pos.y - ap.y;
|
||||||
|
@@ -425,7 +425,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//init stage drag and drop
|
//init stage drag and drop
|
||||||
if(dd && !go.isDragging() && this.isDraggable()) {
|
if(this.isDraggable()) {
|
||||||
this.startDrag(evt);
|
this.startDrag(evt);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -1355,12 +1355,13 @@ Test.Modules.DRAG_AND_DROP = {
|
|||||||
'stage and shape draggable': function(containerId) {
|
'stage and shape draggable': function(containerId) {
|
||||||
var stage = new Kinetic.Stage({
|
var stage = new Kinetic.Stage({
|
||||||
container: containerId,
|
container: containerId,
|
||||||
|
draggable: true,
|
||||||
width: 578,
|
width: 578,
|
||||||
height: 200,
|
height: 200
|
||||||
draggable: true
|
});
|
||||||
|
var layer = new Kinetic.Layer({
|
||||||
|
draggable: true
|
||||||
});
|
});
|
||||||
var layer = new Kinetic.Layer();
|
|
||||||
var group = new Kinetic.Group();
|
|
||||||
|
|
||||||
var rect = new Kinetic.Rect({
|
var rect = new Kinetic.Rect({
|
||||||
x: 150,
|
x: 150,
|
||||||
@@ -1369,8 +1370,7 @@ Test.Modules.DRAG_AND_DROP = {
|
|||||||
height: 50,
|
height: 50,
|
||||||
fill: 'red',
|
fill: 'red',
|
||||||
stroke: 'black',
|
stroke: 'black',
|
||||||
strokeWidth: 4,
|
strokeWidth: 4
|
||||||
draggable: true,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var rect2 = new Kinetic.Rect({
|
var rect2 = new Kinetic.Rect({
|
||||||
|
Reference in New Issue
Block a user