fixed issue with stage panning. stage node type needs to be declared before calling super constructor

This commit is contained in:
Eric Rowell
2013-09-28 21:55:57 -07:00
parent a8cbc2321d
commit e13a0b5fd8
3 changed files with 14 additions and 6 deletions

View File

@@ -399,9 +399,17 @@ suite('DragAndDropEvents', function() {
// ======================================================
test('drag and drop stage', function() {
var stage = addStage();
var container = document.createElement('div'),
stage = new Kinetic.Stage({
container: container,
width: 578,
height: 200,
draggable: true
});
stage.setDraggable(true);
kineticContainer.appendChild(container);
//stage.setDraggable(true);
var layer = new Kinetic.Layer();
@@ -424,7 +432,7 @@ suite('DragAndDropEvents', function() {
* simulate drag and drop
*/
stage._mousedown({
clientX: 100,
clientX: 0,
clientY: 100 + top
});
@@ -440,7 +448,7 @@ suite('DragAndDropEvents', function() {
});
Kinetic.DD._endDragAfter();
assert.equal(stage.getX(), 200);
assert.equal(stage.getX(), 300);
assert.equal(stage.getY(), 10);