mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
added throttling to mousemove and touchmove. Added logic to prevent Android from detecting both touch and mouse events
This commit is contained in:
@@ -1,40 +1,43 @@
|
||||
suite('DragAndDrop', function() {
|
||||
|
||||
// ======================================================
|
||||
test('test drag and drop properties and methods', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Kinetic.Layer();
|
||||
var circle = new Kinetic.Circle({
|
||||
x: stage.getWidth() / 2,
|
||||
y: stage.getHeight() / 2,
|
||||
radius: 70,
|
||||
fill: 'green',
|
||||
stroke: 'black',
|
||||
strokeWidth: 4,
|
||||
name: 'myCircle'
|
||||
});
|
||||
test('test drag and drop properties and methods', function(done) {
|
||||
var stage = addStage();
|
||||
var layer = new Kinetic.Layer();
|
||||
var circle = new Kinetic.Circle({
|
||||
x: stage.getWidth() / 2,
|
||||
y: stage.getHeight() / 2,
|
||||
radius: 70,
|
||||
fill: 'green',
|
||||
stroke: 'black',
|
||||
strokeWidth: 4,
|
||||
name: 'myCircle'
|
||||
});
|
||||
|
||||
stage.add(layer);
|
||||
layer.add(circle);
|
||||
|
||||
setTimeout(function() {
|
||||
layer.draw();
|
||||
|
||||
// test defaults
|
||||
//assert.equal(circle.draggable(), false);
|
||||
layer.draw();
|
||||
|
||||
//change properties
|
||||
circle.setDraggable(true);
|
||||
// test defaults
|
||||
assert.equal(circle.draggable(), false);
|
||||
|
||||
//change properties
|
||||
circle.setDraggable(true);
|
||||
|
||||
|
||||
//circle.on('click', function(){});
|
||||
//circle.on('click', function(){});
|
||||
|
||||
layer.draw();
|
||||
layer.draw();
|
||||
|
||||
showHit(layer);
|
||||
showHit(layer);
|
||||
|
||||
// test new properties
|
||||
//assert.equal(circle.getDraggable(), true);
|
||||
// test new properties
|
||||
assert.equal(circle.getDraggable(), true);
|
||||
|
||||
done();
|
||||
|
||||
}, 50);
|
||||
});
|
||||
|
Reference in New Issue
Block a user