Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/konva/lib/shapes/Sprite.js

    rd565449 r0c6b92a  
    1212        this._updated = true;
    1313        this.anim = new Animation_1.Animation(() => {
    14             var updated = this._updated;
     14            const updated = this._updated;
    1515            this._updated = false;
    1616            return updated;
     
    3131    }
    3232    _sceneFunc(context) {
    33         var 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();
     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();
    3434        if (this.hasFill() || this.hasStroke()) {
    3535            context.beginPath();
     
    4040        if (image) {
    4141            if (offsets) {
    42                 var offset = offsets[anim], ix2 = index * 2;
     42                const offset = offsets[anim], ix2 = index * 2;
    4343                context.drawImage(image, x, y, width, height, offset[ix2 + 0], offset[ix2 + 1], width, height);
    4444            }
     
    4949    }
    5050    _hitFunc(context) {
    51         var anim = 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];
    5252        context.beginPath();
    5353        if (offsets) {
    54             var offset = offsets[anim];
    55             var ix2 = index * 2;
     54            const offset = offsets[anim];
     55            const ix2 = index * 2;
    5656            context.rect(offset[ix2 + 0], offset[ix2 + 1], width, height);
    5757        }
     
    6666    }
    6767    _setInterval() {
    68         var that = this;
     68        const that = this;
    6969        this.interval = setInterval(function () {
    7070            that._updateIndex();
     
    7575            return;
    7676        }
    77         var layer = this.getLayer();
     77        const layer = this.getLayer();
    7878        this.anim.setLayers(layer);
    7979        this._setInterval();
     
    8888    }
    8989    _updateIndex() {
    90         var index = 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;
    9191        if (index < len - 1) {
    9292            this.frameIndex(index + 1);
Note: See TracChangeset for help on using the changeset viewer.