mirror of
https://github.com/konvajs/konva.git
synced 2025-09-24 21:37:18 +08:00
new Canvas class to decouple layer and canvas, providing more flexibility. drawing operations now require a canvas object rather than an optional layer which contained a canvas. fixed some transformation issues introduced with a pull request that I pulled in last week
This commit is contained in:
@@ -14,9 +14,8 @@ Kinetic.Sprite = Kinetic.Shape.extend({
|
||||
frameRate: 17
|
||||
});
|
||||
|
||||
config.drawFunc = function() {
|
||||
config.drawFunc = function(context) {
|
||||
if(!!this.attrs.image) {
|
||||
var context = this.getContext();
|
||||
var anim = this.attrs.animation;
|
||||
var index = this.attrs.index;
|
||||
var f = this.attrs.animations[anim][index];
|
||||
@@ -25,7 +24,7 @@ Kinetic.Sprite = Kinetic.Shape.extend({
|
||||
context.rect(0, 0, f.width, f.height);
|
||||
context.closePath();
|
||||
|
||||
this.drawImage(this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, f.width, f.height);
|
||||
this.drawImage(context, this.attrs.image, f.x, f.y, f.width, f.height, 0, 0, f.width, f.height);
|
||||
}
|
||||
};
|
||||
// call super constructor
|
||||
|
Reference in New Issue
Block a user