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

    rd565449 r0c6b92a  
    55const Global_1 = require("./Global");
    66function simplifyArray(arr) {
    7     var retArr = [], len = arr.length, util = Util_1.Util, n, val;
     7    let retArr = [], len = arr.length, util = Util_1.Util, n, val;
    88    for (n = 0; n < len; n++) {
    99        val = arr[n];
     
    1818    return retArr;
    1919}
    20 var COMMA = ',', OPEN_PAREN = '(', CLOSE_PAREN = ')', OPEN_PAREN_BRACKET = '([', CLOSE_BRACKET_PAREN = '])', SEMICOLON = ';', DOUBLE_PAREN = '()', EQUALS = '=', CONTEXT_METHODS = [
     20const COMMA = ',', OPEN_PAREN = '(', CLOSE_PAREN = ')', OPEN_PAREN_BRACKET = '([', CLOSE_BRACKET_PAREN = '])', SEMICOLON = ';', DOUBLE_PAREN = '()', EQUALS = '=', CONTEXT_METHODS = [
    2121    'arc',
    2222    'arcTo',
     
    5252    'translate',
    5353];
    54 var CONTEXT_PROPERTIES = [
     54const CONTEXT_PROPERTIES = [
    5555    'fillStyle',
    5656    'strokeStyle',
     
    107107    }
    108108    getTrace(relaxed, rounded) {
    109         var traceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args;
     109        let traceArr = this.traceArr, len = traceArr.length, str = '', n, trace, method, args;
    110110        for (n = 0; n < len; n++) {
    111111            trace = traceArr[n];
     
    143143    }
    144144    _trace(str) {
    145         var traceArr = this.traceArr, len;
     145        let traceArr = this.traceArr, len;
    146146        traceArr.push(str);
    147147        len = traceArr.length;
     
    151151    }
    152152    reset() {
    153         var pixelRatio = this.getCanvas().getPixelRatio();
     153        const pixelRatio = this.getCanvas().getPixelRatio();
    154154        this.setTransform(1 * pixelRatio, 0, 0, 1 * pixelRatio, 0, 0);
    155155    }
     
    158158    }
    159159    clear(bounds) {
    160         var canvas = this.getCanvas();
     160        const canvas = this.getCanvas();
    161161        if (bounds) {
    162162            this.clearRect(bounds.x || 0, bounds.y || 0, bounds.width || 0, bounds.height || 0);
     
    173173    }
    174174    _applyOpacity(shape) {
    175         var absOpacity = shape.getAbsoluteOpacity();
     175        const absOpacity = shape.getAbsoluteOpacity();
    176176        if (absOpacity !== 1) {
    177177            this.setAttr('globalAlpha', absOpacity);
     
    209209    }
    210210    createImageData(width, height) {
    211         var a = arguments;
     211        const a = arguments;
    212212        if (a.length === 2) {
    213213            return this._context.createImageData(width, height);
     
    227227    }
    228228    drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight) {
    229         var a = arguments, _context = this._context;
     229        const a = arguments, _context = this._context;
    230230        if (a.length === 3) {
    231231            _context.drawImage(image, sx, sy);
     
    335335    }
    336336    _enableTrace() {
    337         var that = this, len = CONTEXT_METHODS.length, origSetter = this.setAttr, n, args;
    338         var func = function (methodName) {
    339             var origMethod = that[methodName], ret;
     337        let that = this, len = CONTEXT_METHODS.length, origSetter = this.setAttr, n, args;
     338        const func = function (methodName) {
     339            let origMethod = that[methodName], ret;
    340340            that[methodName] = function () {
    341341                args = simplifyArray(Array.prototype.slice.call(arguments, 0));
     
    353353        that.setAttr = function () {
    354354            origSetter.apply(that, arguments);
    355             var prop = arguments[0];
    356             var val = arguments[1];
     355            const prop = arguments[0];
     356            let val = arguments[1];
    357357            if (prop === 'shadowOffsetX' ||
    358358                prop === 'shadowOffsetY' ||
     
    368368    _applyGlobalCompositeOperation(node) {
    369369        const op = node.attrs.globalCompositeOperation;
    370         var def = !op || op === 'source-over';
     370        const def = !op || op === 'source-over';
    371371        if (!def) {
    372372            this.setAttr('globalCompositeOperation', op);
     
    393393    }
    394394    _fillColor(shape) {
    395         var fill = shape.fill();
     395        const fill = shape.fill();
    396396        this.setAttr('fillStyle', fill);
    397397        shape._fillFunc(this);
     
    402402    }
    403403    _fillLinearGradient(shape) {
    404         var grd = shape._getLinearGradient();
     404        const grd = shape._getLinearGradient();
    405405        if (grd) {
    406406            this.setAttr('fillStyle', grd);
     
    452452        const start = shape.getStrokeLinearGradientStartPoint(), end = shape.getStrokeLinearGradientEndPoint(), colorStops = shape.getStrokeLinearGradientColorStops(), grd = this.createLinearGradient(start.x, start.y, end.x, end.y);
    453453        if (colorStops) {
    454             for (var n = 0; n < colorStops.length; n += 2) {
     454            for (let n = 0; n < colorStops.length; n += 2) {
    455455                grd.addColorStop(colorStops[n], colorStops[n + 1]);
    456456            }
     
    459459    }
    460460    _stroke(shape) {
    461         var dash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled();
     461        const dash = shape.dash(), strokeScaleEnabled = shape.getStrokeScaleEnabled();
    462462        if (shape.hasStroke()) {
    463463            if (!strokeScaleEnabled) {
    464464                this.save();
    465                 var pixelRatio = this.getCanvas().getPixelRatio();
     465                const pixelRatio = this.getCanvas().getPixelRatio();
    466466                this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
    467467            }
     
    475475                this.setAttr('shadowColor', 'rgba(0,0,0,0)');
    476476            }
    477             var hasLinearGradient = shape.getStrokeLinearGradientColorStops();
     477            const hasLinearGradient = shape.getStrokeLinearGradientColorStops();
    478478            if (hasLinearGradient) {
    479479                this._strokeLinearGradient(shape);
     
    490490    _applyShadow(shape) {
    491491        var _a, _b, _c;
    492         var color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {
     492        const color = (_a = shape.getShadowRGBA()) !== null && _a !== void 0 ? _a : 'black', blur = (_b = shape.getShadowBlur()) !== null && _b !== void 0 ? _b : 5, offset = (_c = shape.getShadowOffset()) !== null && _c !== void 0 ? _c : {
    493493            x: 0,
    494494            y: 0,
     
    524524            if (!strokeScaleEnabled) {
    525525                this.save();
    526                 var pixelRatio = this.getCanvas().getPixelRatio();
     526                const pixelRatio = this.getCanvas().getPixelRatio();
    527527                this.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
    528528            }
    529529            this._applyLineCap(shape);
    530             var hitStrokeWidth = shape.hitStrokeWidth();
    531             var strokeWidth = hitStrokeWidth === 'auto' ? shape.strokeWidth() : hitStrokeWidth;
     530            const hitStrokeWidth = shape.hitStrokeWidth();
     531            const strokeWidth = hitStrokeWidth === 'auto' ? shape.strokeWidth() : hitStrokeWidth;
    532532            this.setAttr('lineWidth', strokeWidth);
    533533            this.setAttr('strokeStyle', shape.colorKey);
Note: See TracChangeset for help on using the changeset viewer.