npm update with fix to new eslint issues
This commit is contained in:
@@ -1893,10 +1893,9 @@ export const pathActions = (function () {
|
||||
const absY = seglist.getItem(0).y;
|
||||
|
||||
sSeg = stretchy.pathSegList.getItem(1);
|
||||
if (sSeg.pathSegType === 4) {
|
||||
newseg = drawnPath.createSVGPathSegLinetoAbs(absX, absY);
|
||||
} else {
|
||||
newseg = drawnPath.createSVGPathSegCurvetoCubicAbs(
|
||||
newseg = (sSeg.pathSegType === 4)
|
||||
? drawnPath.createSVGPathSegLinetoAbs(absX, absY)
|
||||
: drawnPath.createSVGPathSegCurvetoCubicAbs(
|
||||
absX,
|
||||
absY,
|
||||
sSeg.x1 / currentZoom,
|
||||
@@ -1904,8 +1903,6 @@ export const pathActions = (function () {
|
||||
absX,
|
||||
absY
|
||||
);
|
||||
}
|
||||
|
||||
const endseg = drawnPath.createSVGPathSegClosePath();
|
||||
seglist.appendItem(newseg);
|
||||
seglist.appendItem(endseg);
|
||||
@@ -1960,13 +1957,12 @@ export const pathActions = (function () {
|
||||
|
||||
// Use the segment defined by stretchy
|
||||
sSeg = stretchy.pathSegList.getItem(1);
|
||||
if (sSeg.pathSegType === 4) {
|
||||
newseg = drawnPath.createSVGPathSegLinetoAbs(
|
||||
newseg = (sSeg.pathSegType === 4)
|
||||
? drawnPath.createSVGPathSegLinetoAbs(
|
||||
editorContext_.round(x),
|
||||
editorContext_.round(y)
|
||||
);
|
||||
} else {
|
||||
newseg = drawnPath.createSVGPathSegCurvetoCubicAbs(
|
||||
)
|
||||
: drawnPath.createSVGPathSegCurvetoCubicAbs(
|
||||
editorContext_.round(x),
|
||||
editorContext_.round(y),
|
||||
sSeg.x1 / currentZoom,
|
||||
@@ -1974,7 +1970,6 @@ export const pathActions = (function () {
|
||||
sSeg.x2 / currentZoom,
|
||||
sSeg.y2 / currentZoom
|
||||
);
|
||||
}
|
||||
|
||||
drawnPath.pathSegList.appendItem(newseg);
|
||||
|
||||
|
||||
@@ -269,13 +269,7 @@ export const recalculateDimensions = function (selected) {
|
||||
const gangle = getRotationAngle(selected);
|
||||
if (gangle) {
|
||||
const a = gangle * Math.PI / 180;
|
||||
let s;
|
||||
if (Math.abs(a) > (1.0e-10)) {
|
||||
s = Math.sin(a) / (1 - Math.cos(a));
|
||||
} else {
|
||||
// TODO: This blows up if the angle is exactly 0!
|
||||
s = 2 / a;
|
||||
}
|
||||
const s = Math.abs(a) > (1.0e-10) ? Math.sin(a) / (1 - Math.cos(a)) : 2 / a;
|
||||
for (let i = 0; i < tlist.numberOfItems; ++i) {
|
||||
const xform = tlist.getItem(i);
|
||||
if (xform.type === 4) {
|
||||
|
||||
@@ -2689,11 +2689,7 @@ class SvgCanvas {
|
||||
end = {x: 0, y: 0};
|
||||
const coords = element.getAttribute('points');
|
||||
const commaIndex = coords.indexOf(',');
|
||||
if (commaIndex >= 0) {
|
||||
keep = coords.includes(',', commaIndex + 1);
|
||||
} else {
|
||||
keep = coords.includes(' ', coords.indexOf(' ') + 1);
|
||||
}
|
||||
keep = commaIndex >= 0 ? coords.includes(',', commaIndex + 1) : coords.includes(' ', coords.indexOf(' ') + 1);
|
||||
if (keep) {
|
||||
element = pathActions.smoothPolylineIntoPath(element);
|
||||
}
|
||||
@@ -4495,11 +4491,9 @@ function hideCursor () {
|
||||
|
||||
// set new svg document
|
||||
// If DOM3 adoptNode() available, use it. Otherwise fall back to DOM2 importNode()
|
||||
if (svgdoc.adoptNode) {
|
||||
svgcontent = svgdoc.adoptNode(newDoc.documentElement);
|
||||
} else {
|
||||
svgcontent = svgdoc.importNode(newDoc.documentElement, true);
|
||||
}
|
||||
svgcontent = svgdoc.adoptNode
|
||||
? svgdoc.adoptNode(newDoc.documentElement)
|
||||
: svgdoc.importNode(newDoc.documentElement, true);
|
||||
|
||||
svgroot.append(svgcontent);
|
||||
const content = $(svgcontent);
|
||||
@@ -4681,13 +4675,9 @@ function hideCursor () {
|
||||
this.prepareSvg(newDoc);
|
||||
|
||||
// import new svg document into our document
|
||||
let svg;
|
||||
// If DOM3 adoptNode() available, use it. Otherwise fall back to DOM2 importNode()
|
||||
if (svgdoc.adoptNode) {
|
||||
svg = svgdoc.adoptNode(newDoc.documentElement);
|
||||
} else {
|
||||
svg = svgdoc.importNode(newDoc.documentElement, true);
|
||||
}
|
||||
const svg =
|
||||
svgdoc.adoptNode ? svgdoc.adoptNode(newDoc.documentElement) : svgdoc.importNode(newDoc.documentElement, true);
|
||||
|
||||
uniquifyElems(svg);
|
||||
|
||||
@@ -4705,11 +4695,7 @@ function hideCursor () {
|
||||
canvash = Number(svgcontent.getAttribute('height'));
|
||||
// imported content should be 1/3 of the canvas on its largest dimension
|
||||
|
||||
if (innerh > innerw) {
|
||||
ts = 'scale(' + (canvash / 3) / vb[3] + ')';
|
||||
} else {
|
||||
ts = 'scale(' + (canvash / 3) / vb[2] + ')';
|
||||
}
|
||||
ts = innerh > innerw ? 'scale(' + (canvash / 3) / vb[3] + ')' : 'scale(' + (canvash / 3) / vb[2] + ')';
|
||||
|
||||
// Hack to make recalculateDimensions understand how to scale
|
||||
ts = 'translate(0) ' + ts + ' translate(0)';
|
||||
|
||||
Reference in New Issue
Block a user