mirror of
https://github.com/konvajs/konva.git
synced 2025-11-24 08:46:44 +08:00
change method name
This commit is contained in:
@@ -87,7 +87,7 @@
|
||||
index = this.frameIndex(),
|
||||
ix4 = index * 4,
|
||||
set = this.getAnimations()[anim],
|
||||
offsets = this.getOffsets(),
|
||||
offsets = this.frameOffsets(),
|
||||
x = set[ix4 + 0],
|
||||
y = set[ix4 + 1],
|
||||
width = set[ix4 + 2],
|
||||
@@ -109,11 +109,18 @@
|
||||
index = this.frameIndex(),
|
||||
ix4 = index * 4,
|
||||
set = this.getAnimations()[anim],
|
||||
offsets = this.frameOffsets(),
|
||||
width = set[ix4 + 2],
|
||||
height = set[ix4 + 3];
|
||||
|
||||
context.beginPath();
|
||||
if (offsets) {
|
||||
var offset = offsets[anim];
|
||||
var ix2 = index * 2;
|
||||
context.rect(offset[ix2 + 0], offset[ix2 + 1], width, height);
|
||||
} else {
|
||||
context.rect(0, 0, width, height);
|
||||
}
|
||||
context.closePath();
|
||||
context.fillShape(this);
|
||||
},
|
||||
@@ -233,7 +240,7 @@
|
||||
* });
|
||||
*/
|
||||
|
||||
Kinetic.Factory.addGetterSetter(Kinetic.Sprite, 'offsets');
|
||||
Kinetic.Factory.addGetterSetter(Kinetic.Sprite, 'frameOffsets');
|
||||
|
||||
/**
|
||||
* get/set offsets map
|
||||
|
||||
BIN
test/assets/rabbit.png
Normal file
BIN
test/assets/rabbit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 194 KiB |
Reference in New Issue
Block a user