Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/konva/lib/shapes/Sprite.js
rd565449 r0c6b92a 12 12 this._updated = true; 13 13 this.anim = new Animation_1.Animation(() => { 14 varupdated = this._updated;14 const updated = this._updated; 15 15 this._updated = false; 16 16 return updated; … … 31 31 } 32 32 _sceneFunc(context) { 33 varanim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x = set[ix4 + 0], y = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image();33 const anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), x = set[ix4 + 0], y = set[ix4 + 1], width = set[ix4 + 2], height = set[ix4 + 3], image = this.image(); 34 34 if (this.hasFill() || this.hasStroke()) { 35 35 context.beginPath(); … … 40 40 if (image) { 41 41 if (offsets) { 42 varoffset = offsets[anim], ix2 = index * 2;42 const offset = offsets[anim], ix2 = index * 2; 43 43 context.drawImage(image, x, y, width, height, offset[ix2 + 0], offset[ix2 + 1], width, height); 44 44 } … … 49 49 } 50 50 _hitFunc(context) { 51 varanim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3];51 const anim = this.animation(), index = this.frameIndex(), ix4 = index * 4, set = this.animations()[anim], offsets = this.frameOffsets(), width = set[ix4 + 2], height = set[ix4 + 3]; 52 52 context.beginPath(); 53 53 if (offsets) { 54 varoffset = offsets[anim];55 varix2 = index * 2;54 const offset = offsets[anim]; 55 const ix2 = index * 2; 56 56 context.rect(offset[ix2 + 0], offset[ix2 + 1], width, height); 57 57 } … … 66 66 } 67 67 _setInterval() { 68 varthat = this;68 const that = this; 69 69 this.interval = setInterval(function () { 70 70 that._updateIndex(); … … 75 75 return; 76 76 } 77 varlayer = this.getLayer();77 const layer = this.getLayer(); 78 78 this.anim.setLayers(layer); 79 79 this._setInterval(); … … 88 88 } 89 89 _updateIndex() { 90 varindex = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4;90 const index = this.frameIndex(), animation = this.animation(), animations = this.animations(), anim = animations[animation], len = anim.length / 4; 91 91 if (index < len - 1) { 92 92 this.frameIndex(index + 1);
Note:
See TracChangeset
for help on using the changeset viewer.