mirror of
https://github.com/konvajs/konva.git
synced 2025-09-22 20:14:01 +08:00
draw methods now draw on both the front and back buffer by default, unless a canvas is passed as an argument. continued fixing up unit tests. Image width and height are now synced whenever the image object changes.
This commit is contained in:
@@ -25,10 +25,17 @@ Kinetic.Sprite = Kinetic.Shape.extend({
|
||||
});
|
||||
},
|
||||
drawFunc: function(context) {
|
||||
var anim = this.attrs.animation;
|
||||
var index = this.attrs.index;
|
||||
var f = this.attrs.animations[anim][index];
|
||||
|
||||
context.beginPath();
|
||||
context.rect(0, 0, f.width, f.height);
|
||||
context.closePath();
|
||||
this.fill(context);
|
||||
this.stroke(context);
|
||||
|
||||
if(this.attrs.image) {
|
||||
var anim = this.attrs.animation;
|
||||
var index = this.attrs.index;
|
||||
var f = this.attrs.animations[anim][index];
|
||||
|
||||
context.beginPath();
|
||||
context.rect(0, 0, f.width, f.height);
|
||||
|
Reference in New Issue
Block a user