mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
changed around the logic from the previous pull, and also added spriteTests to the unit test build
This commit is contained in:
@@ -32,13 +32,13 @@
|
||||
var anim = this.attrs.animation;
|
||||
var index = this.attrs.index;
|
||||
var f = this.attrs.animations[anim][index];
|
||||
var width = this.attrs.width || f.width;
|
||||
var height = this.attrs.height || f.height;
|
||||
var width = f.width || this.attrs.width;
|
||||
var height = f.height || this.attrs.height;
|
||||
|
||||
if(this.attrs.image) {
|
||||
|
||||
context.beginPath();
|
||||
context.rect(0, 0, f.width, f.height);
|
||||
context.rect(0, 0, width, height);
|
||||
context.closePath();
|
||||
|
||||
this.drawImage(context, this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, width, height);
|
||||
|
Reference in New Issue
Block a user