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/Canvas.js

    rd565449 r0c6b92a  
    77const Factory_1 = require("./Factory");
    88const Validators_1 = require("./Validators");
    9 var _pixelRatio;
     9let _pixelRatio;
    1010function getDevicePixelRatio() {
    1111    if (_pixelRatio) {
    1212        return _pixelRatio;
    1313    }
    14     var canvas = Util_1.Util.createCanvasElement();
    15     var context = canvas.getContext('2d');
     14    const canvas = Util_1.Util.createCanvasElement();
     15    const context = canvas.getContext('2d');
    1616    _pixelRatio = (function () {
    17         var devicePixelRatio = Global_1.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio ||
     17        const devicePixelRatio = Global_1.Konva._global.devicePixelRatio || 1, backingStoreRatio = context.webkitBackingStorePixelRatio ||
    1818            context.mozBackingStorePixelRatio ||
    1919            context.msBackingStorePixelRatio ||
     
    3232        this.height = 0;
    3333        this.isCache = false;
    34         var conf = config || {};
    35         var pixelRatio = conf.pixelRatio || Global_1.Konva.pixelRatio || getDevicePixelRatio();
     34        const conf = config || {};
     35        const pixelRatio = conf.pixelRatio || Global_1.Konva.pixelRatio || getDevicePixelRatio();
    3636        this.pixelRatio = pixelRatio;
    3737        this._canvas = Util_1.Util.createCanvasElement();
     
    5151    }
    5252    setPixelRatio(pixelRatio) {
    53         var previousRatio = this.pixelRatio;
     53        const previousRatio = this.pixelRatio;
    5454        this.pixelRatio = pixelRatio;
    5555        this.setSize(this.getWidth() / previousRatio, this.getHeight() / previousRatio);
     
    5858        this.width = this._canvas.width = width * this.pixelRatio;
    5959        this._canvas.style.width = width + 'px';
    60         var pixelRatio = this.pixelRatio, _context = this.getContext()._context;
     60        const pixelRatio = this.pixelRatio, _context = this.getContext()._context;
    6161        _context.scale(pixelRatio, pixelRatio);
    6262    }
     
    6464        this.height = this._canvas.height = height * this.pixelRatio;
    6565        this._canvas.style.height = height + 'px';
    66         var pixelRatio = this.pixelRatio, _context = this.getContext()._context;
     66        const pixelRatio = this.pixelRatio, _context = this.getContext()._context;
    6767        _context.scale(pixelRatio, pixelRatio);
    6868    }
Note: See TracChangeset for help on using the changeset viewer.