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

    rd565449 r0c6b92a  
    99const Global_2 = require("./Global");
    1010const PointerEvents = require("./PointerEvents");
    11 var HAS_SHADOW = 'hasShadow';
    12 var SHADOW_RGBA = 'shadowRGBA';
    13 var patternImage = 'patternImage';
    14 var linearGradient = 'linearGradient';
    15 var radialGradient = 'radialGradient';
     11const HAS_SHADOW = 'hasShadow';
     12const SHADOW_RGBA = 'shadowRGBA';
     13const patternImage = 'patternImage';
     14const linearGradient = 'linearGradient';
     15const radialGradient = 'radialGradient';
    1616let dummyContext;
    1717function getDummyContext() {
     
    105105    __getFillPattern() {
    106106        if (this.fillPatternImage()) {
    107             var ctx = getDummyContext();
     107            const ctx = getDummyContext();
    108108            const pattern = ctx.createPattern(this.fillPatternImage(), this.fillPatternRepeat() || 'repeat');
    109109            if (pattern && pattern.setTransform) {
     
    133133    }
    134134    __getLinearGradient() {
    135         var colorStops = this.fillLinearGradientColorStops();
     135        const colorStops = this.fillLinearGradientColorStops();
    136136        if (colorStops) {
    137             var ctx = getDummyContext();
    138             var start = this.fillLinearGradientStartPoint();
    139             var end = this.fillLinearGradientEndPoint();
    140             var grd = ctx.createLinearGradient(start.x, start.y, end.x, end.y);
    141             for (var n = 0; n < colorStops.length; n += 2) {
     137            const ctx = getDummyContext();
     138            const start = this.fillLinearGradientStartPoint();
     139            const end = this.fillLinearGradientEndPoint();
     140            const grd = ctx.createLinearGradient(start.x, start.y, end.x, end.y);
     141            for (let n = 0; n < colorStops.length; n += 2) {
    142142                grd.addColorStop(colorStops[n], colorStops[n + 1]);
    143143            }
     
    149149    }
    150150    __getRadialGradient() {
    151         var colorStops = this.fillRadialGradientColorStops();
     151        const colorStops = this.fillRadialGradientColorStops();
    152152        if (colorStops) {
    153             var ctx = getDummyContext();
    154             var start = this.fillRadialGradientStartPoint();
    155             var end = this.fillRadialGradientEndPoint();
    156             var grd = ctx.createRadialGradient(start.x, start.y, this.fillRadialGradientStartRadius(), end.x, end.y, this.fillRadialGradientEndRadius());
    157             for (var n = 0; n < colorStops.length; n += 2) {
     153            const ctx = getDummyContext();
     154            const start = this.fillRadialGradientStartPoint();
     155            const end = this.fillRadialGradientEndPoint();
     156            const grd = ctx.createRadialGradient(start.x, start.y, this.fillRadialGradientStartRadius(), end.x, end.y, this.fillRadialGradientEndRadius());
     157            for (let n = 0; n < colorStops.length; n += 2) {
    158158                grd.addColorStop(colorStops[n], colorStops[n + 1]);
    159159            }
     
    168168            return;
    169169        }
    170         var rgba = Util_1.Util.colorToRGBA(this.shadowColor());
     170        const rgba = Util_1.Util.colorToRGBA(this.shadowColor());
    171171        if (rgba) {
    172172            return ('rgba(' +
     
    216216    }
    217217    intersects(point) {
    218         var stage = this.getStage();
     218        const stage = this.getStage();
    219219        if (!stage) {
    220220            return false;
     
    269269    }
    270270    getSelfRect() {
    271         var size = this.size();
     271        const size = this.size();
    272272        return {
    273273            x: this._centroid ? -size.width / 2 : 0,
     
    318318    }
    319319    drawScene(can, top, bufferCanvas) {
    320         var layer = this.getLayer();
    321         var canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext;
    322         var skipBuffer = canvas.isCache;
    323         var cachingSelf = top === this;
     320        const layer = this.getLayer();
     321        let canvas = can || layer.getCanvas(), context = canvas.getContext(), cachedCanvas = this._getCanvasCache(), drawFunc = this.getSceneFunc(), hasShadow = this.hasShadow(), stage, bufferContext;
     322        const skipBuffer = canvas.isCache;
     323        const cachingSelf = top === this;
    324324        if (!this.isVisible() && !cachingSelf) {
    325325            return this;
     
    327327        if (cachedCanvas) {
    328328            context.save();
    329             var m = this.getAbsoluteTransform(top).getMatrix();
     329            const m = this.getAbsoluteTransform(top).getMatrix();
    330330            context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
    331331            this._drawCachedSceneCanvas(context);
     
    348348            drawFunc.call(this, bufferContext, this);
    349349            bufferContext.restore();
    350             var ratio = bc.pixelRatio;
     350            const ratio = bc.pixelRatio;
    351351            if (hasShadow) {
    352352                context._applyShadow(this);
     
    376376            return this;
    377377        }
    378         var layer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
     378        const layer = this.getLayer(), canvas = can || layer.hitCanvas, context = canvas && canvas.getContext(), drawFunc = this.hitFunc() || this.sceneFunc(), cachedCanvas = this._getCanvasCache(), cachedHitCanvas = cachedCanvas && cachedCanvas.hit;
    379379        if (!this.colorKey) {
    380380            Util_1.Util.warn('Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()');
     
    382382        if (cachedHitCanvas) {
    383383            context.save();
    384             var m = this.getAbsoluteTransform(top).getMatrix();
     384            const m = this.getAbsoluteTransform(top).getMatrix();
    385385            context.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
    386386            this._drawCachedHitCanvas(context);
     
    395395        const selfCache = this === top;
    396396        if (!selfCache) {
    397             var o = this.getAbsoluteTransform(top).getMatrix();
     397            const o = this.getAbsoluteTransform(top).getMatrix();
    398398            context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
    399399        }
     
    403403    }
    404404    drawHitFromCache(alphaThreshold = 0) {
    405         var cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;
     405        let cachedCanvas = this._getCanvasCache(), sceneCanvas = this._getCachedSceneCanvas(), hitCanvas = cachedCanvas.hit, hitContext = hitCanvas.getContext(), hitWidth = hitCanvas.getWidth(), hitHeight = hitCanvas.getHeight(), hitImageData, hitData, len, rgbColorKey, i, alpha;
    406406        hitContext.clear();
    407407        hitContext.drawImage(sceneCanvas._canvas, 0, 0, hitWidth, hitHeight);
Note: See TracChangeset for help on using the changeset viewer.