mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 09:07:30 +08:00
changed around the logic from the previous pull, and also added spriteTests to the unit test build
This commit is contained in:
3
Thorfile
3
Thorfile
@@ -30,7 +30,8 @@ class Build < Thor
|
||||
"tests/js/unit/shapes/regularPolygonTests.js",
|
||||
"tests/js/unit/shapes/starTests.js",
|
||||
"tests/js/unit/shapes/textTests.js",
|
||||
"tests/js/unit/shapes/pathTests.js"
|
||||
"tests/js/unit/shapes/pathTests.js",
|
||||
"tests/js/unit/shapes/spriteTests.js"
|
||||
]
|
||||
|
||||
if !File.directory?("dist")
|
||||
|
||||
@@ -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