mirror of
https://github.com/konvajs/konva.git
synced 2025-08-23 20:15:07 +08:00
fixed #610
This commit is contained in:
parent
c0313e360e
commit
6e8a5b74b9
@ -101,7 +101,7 @@
|
|||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.rect(0, 0, f.width, f.height);
|
context.rect(0, 0, f.width, f.height);
|
||||||
context.closePath();
|
context.closePath();
|
||||||
context.fill(this);
|
context.fillShape(this);
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* start sprite animation
|
* start sprite animation
|
||||||
|
@ -91,11 +91,20 @@ suite('Sprite', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
layer.add(sprite);
|
layer.add(sprite);
|
||||||
|
stage.add(layer);
|
||||||
|
|
||||||
|
assert.equal(sprite.getClassName(), 'Sprite');
|
||||||
|
assert.equal(sprite.getIndex(), 0);
|
||||||
|
|
||||||
|
showHit(layer);
|
||||||
|
|
||||||
|
var trace = layer.hitCanvas.getContext().getTrace();
|
||||||
|
|
||||||
|
assert.equal(trace.indexOf(sprite.colorKey) >= 0, true);
|
||||||
|
|
||||||
sprite.start();
|
sprite.start();
|
||||||
|
|
||||||
|
|
||||||
stage.add(layer);
|
|
||||||
|
|
||||||
// kick once
|
// kick once
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
sprite.setAnimation('kicking');
|
sprite.setAnimation('kicking');
|
||||||
@ -108,8 +117,7 @@ suite('Sprite', function() {
|
|||||||
sprite.stop();
|
sprite.stop();
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
|
||||||
assert.equal(sprite.getClassName(), 'Sprite');
|
|
||||||
assert.equal(sprite.getIndex(), 0);
|
|
||||||
|
|
||||||
done();
|
done();
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user