From ebffaa4bf02e2715fe088f45fe97294031af85dc Mon Sep 17 00:00:00 2001 From: JFH Date: Mon, 3 Aug 2020 17:39:05 +0200 Subject: [PATCH] fix the cicular reference --- src/common/math.js | 3 +-- src/common/units.js | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/common/math.js b/src/common/math.js index 53efabb2..0d474381 100644 --- a/src/common/math.js +++ b/src/common/math.js @@ -21,7 +21,6 @@ import {NS} from './namespaces.js'; import {getTransformList} from './svgtransformlist.js'; -import {isNullish} from './utilities.js'; // Constants const NEAR_ZERO = 1e-14; @@ -152,7 +151,7 @@ export const transformBox = function (l, t, w, h, m) { * @returns {SVGTransform} A single matrix transform object */ export const transformListToTransform = function (tlist, min, max) { - if (isNullish(tlist)) { + if (!tlist) { // Or should tlist = null have been prevented before this? return svg.createSVGTransformFromMatrix(svg.createSVGMatrix()); } diff --git a/src/common/units.js b/src/common/units.js index 0e065cfa..c2bf694d 100644 --- a/src/common/units.js +++ b/src/common/units.js @@ -7,7 +7,6 @@ */ import {NS} from './namespaces.js'; -import {isNullish} from './utilities.js'; const wAttrs = ['x', 'x1', 'cx', 'rx', 'width']; const hAttrs = ['y', 'y1', 'cy', 'ry', 'height']; @@ -306,7 +305,7 @@ export const isValidUnit = function (attr, val, selectedElement) { // not already present try { const elem = elementContainer_.getElement(val); - result = (isNullish(elem) || elem === selectedElement); + result = (!elem || elem === selectedElement); } catch (e) {} return result; }