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