mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
removed unecessary rect draw in sprite scene graph draw func, and changed width and height logic in sprite hit graph draw func
This commit is contained in:
@@ -36,11 +36,6 @@
|
||||
var height = f.height || this.attrs.height;
|
||||
|
||||
if(this.attrs.image) {
|
||||
|
||||
context.beginPath();
|
||||
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);
|
||||
}
|
||||
},
|
||||
@@ -48,13 +43,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;
|
||||
|
||||
context.beginPath();
|
||||
context.rect(0, 0, width, height);
|
||||
context.closePath();
|
||||
this.fillStroke(context);
|
||||
this.fill(context);
|
||||
},
|
||||
/**
|
||||
* start sprite animation
|
||||
|
Reference in New Issue
Block a user