From 2a0666aa1c970228b04267a82fe4f7458bbff72c Mon Sep 17 00:00:00 2001 From: Agriya Dev5 Date: Mon, 24 May 2021 12:38:46 +0530 Subject: [PATCH] #104 extend jquery convert to javascript --- src/editor/ConfigObj.js | 2 -- src/svgcanvas/recalculate.js | 3 ++- src/svgcanvas/svgcanvas.js | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/editor/ConfigObj.js b/src/editor/ConfigObj.js index 72bd5636..94c7c238 100644 --- a/src/editor/ConfigObj.js +++ b/src/editor/ConfigObj.js @@ -402,7 +402,6 @@ export default class ConfigObj { */ const extendOrAdd = (cfgObj, key, val) => { if (cfgObj[key] && typeof cfgObj[key] === 'object') { - // $.extend(true, cfgObj[key], val); cfgObj[key] = mergeDeep(cfgObj[key], val); } else { cfgObj[key] = val; @@ -452,7 +451,6 @@ export default class ConfigObj { } else if (this.defaultConfig[key] && typeof this.defaultConfig[key] === 'object') { this.curConfig[key] = Array.isArray(this.defaultConfig[key]) ? [] : {}; this.curConfig[key] = mergeDeep(this.curConfig[key], val); - // $.extend(true, this.curConfig[key], val); // Merge properties recursively, e.g., on initFill, initStroke objects } else { this.curConfig[key] = val; } diff --git a/src/svgcanvas/recalculate.js b/src/svgcanvas/recalculate.js index 815e8254..796c3927 100644 --- a/src/svgcanvas/recalculate.js +++ b/src/svgcanvas/recalculate.js @@ -239,7 +239,8 @@ export const recalculateDimensions = function (selected) { // if we haven't created an initial array in polygon/polyline/path, then // make a copy of initial values and include the transform if (isNullish(initial)) { - initial = $.extend(true, {}, changes); + const canvas = context_.getCanvas(); + initial = canvas.mergeDeep({}, changes); for (const [ attr, val ] of Object.entries(initial)) { initial[attr] = convertToNum(attr, val); } diff --git a/src/svgcanvas/svgcanvas.js b/src/svgcanvas/svgcanvas.js index a77639f0..dc82a15f 100644 --- a/src/svgcanvas/svgcanvas.js +++ b/src/svgcanvas/svgcanvas.js @@ -480,7 +480,8 @@ class SvgCanvas { getSVGRoot, getStartTransform() { return startTransform; }, setStartTransform(transform) { startTransform = transform; }, - getDataStorage + getDataStorage, + getCanvas() { return canvas; }, } ); this.recalculateDimensions = recalculateDimensions;