- Refactoring: Use `static` keyword for classes

master
Brett Zamir 2019-05-08 09:58:18 +08:00
parent fc0c53f61a
commit 597644999d
22 changed files with 615 additions and 557 deletions

View File

@ -1,5 +1,9 @@
# SVG-Edit CHANGES
## ?
- Refactoring: Use `static` keyword for classes
## 5.0.0
- Breaking change: Switch from deprecated `@babel/polyfill` to

20
dist/canvg.js vendored
View File

@ -521,12 +521,14 @@ var canvg = (function (exports) {
return '#' + r + g + b;
}
}]);
/**
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
return RGBColor;
}();
RGBColor.getHelpXML = function () {
}], [{
key: "getHelpXML",
value: function getHelpXML() {
var examples = [].concat(_toConsumableArray(colorDefs.flatMap(function (_ref2) {
var example = _ref2.example;
return example;
@ -538,7 +540,7 @@ var canvg = (function (exports) {
var listItem = document.createElement('li');
var listColor = new RGBColor(example);
var exampleDiv = document.createElement('div');
exampleDiv.style.cssText = "\nmargin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.style.cssText = "\n margin: 3px;\n border: 1px solid black;\n background: ".concat(listColor.toHex(), ";\n color: ").concat(listColor.toHex(), ";");
exampleDiv.append('test');
var listItemValue = " ".concat(example, " -> ").concat(listColor.toRGB(), " -> ").concat(listColor.toHex());
listItem.append(exampleDiv, listItemValue);
@ -548,7 +550,11 @@ var canvg = (function (exports) {
}
})));
return xml;
};
}
}]);
return RGBColor;
}();
function _typeof$1(obj) {
if (typeof Symbol === "function" && _typeof(Symbol.iterator) === "symbol") {

View File

@ -521,12 +521,14 @@ var svgEditorExtension_server_moinsave = (function () {
return '#' + r + g + b;
}
}]);
/**
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
return RGBColor;
}();
RGBColor.getHelpXML = function () {
}], [{
key: "getHelpXML",
value: function getHelpXML() {
var examples = [].concat(_toConsumableArray(colorDefs.flatMap(function (_ref2) {
var example = _ref2.example;
return example;
@ -538,7 +540,7 @@ var svgEditorExtension_server_moinsave = (function () {
var listItem = document.createElement('li');
var listColor = new RGBColor(example);
var exampleDiv = document.createElement('div');
exampleDiv.style.cssText = "\nmargin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.style.cssText = "\n margin: 3px;\n border: 1px solid black;\n background: ".concat(listColor.toHex(), ";\n color: ").concat(listColor.toHex(), ";");
exampleDiv.append('test');
var listItemValue = " ".concat(example, " -> ").concat(listColor.toRGB(), " -> ").concat(listColor.toHex());
listItem.append(exampleDiv, listItemValue);
@ -548,7 +550,11 @@ var svgEditorExtension_server_moinsave = (function () {
}
})));
return xml;
};
}
}]);
return RGBColor;
}();
function _typeof$1(obj) {
if (typeof Symbol === "function" && _typeof(Symbol.iterator) === "symbol") {

View File

@ -521,12 +521,14 @@ var svgEditorExtension_server_opensave = (function () {
return '#' + r + g + b;
}
}]);
/**
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
return RGBColor;
}();
RGBColor.getHelpXML = function () {
}], [{
key: "getHelpXML",
value: function getHelpXML() {
var examples = [].concat(_toConsumableArray(colorDefs.flatMap(function (_ref2) {
var example = _ref2.example;
return example;
@ -538,7 +540,7 @@ var svgEditorExtension_server_opensave = (function () {
var listItem = document.createElement('li');
var listColor = new RGBColor(example);
var exampleDiv = document.createElement('div');
exampleDiv.style.cssText = "\nmargin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.style.cssText = "\n margin: 3px;\n border: 1px solid black;\n background: ".concat(listColor.toHex(), ";\n color: ").concat(listColor.toHex(), ";");
exampleDiv.append('test');
var listItemValue = " ".concat(example, " -> ").concat(listColor.toRGB(), " -> ").concat(listColor.toHex());
listItem.append(exampleDiv, listItemValue);
@ -548,7 +550,11 @@ var svgEditorExtension_server_opensave = (function () {
}
})));
return xml;
};
}
}]);
return RGBColor;
}();
function _typeof$1(obj) {
if (typeof Symbol === "function" && _typeof(Symbol.iterator) === "symbol") {

83
dist/index-es.js vendored
View File

@ -2559,6 +2559,22 @@ var getReverseNS = function getReverseNS() {
}
return builder.pathSegList;
} // STATIC
}], [{
key: "_pathSegArrayAsString",
value: function _pathSegArrayAsString(pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}
}]);
@ -2573,24 +2589,9 @@ var getReverseNS = function getReverseNS() {
return this._list.length;
},
enumerable: true
});
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}; // Add the pathSegList accessors to SVGPathElement.
}); // Add the pathSegList accessors to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
Object.defineProperties(SVGPathElement.prototype, {
pathSegList: {
get: function get() {
@ -6316,17 +6317,16 @@ function () {
grips: grips,
closedSubpath: closedSubpath
});
}
}]);
} // STATIC
return Path;
}();
/**
* @param {Integer} index
* @returns {boolean}
*/
/**
* @param {Integer} index
* @returns {boolean}
*/
Path.subpathIsClosed = function (index) {
}], [{
key: "subpathIsClosed",
value: function subpathIsClosed(index) {
var clsd = false; // Check if subpath is already open
path.eachSeg(function (i) {
@ -6348,14 +6348,17 @@ Path.subpathIsClosed = function (index) {
return true;
});
return clsd;
};
}
}]);
return Path;
}();
/**
* @function module:path.getPath_
* @param {SVGPathElement} elem
* @returns {module:path.Path}
*/
var getPath_ = function getPath_(elem) {
var p = pathData[elem.id];
@ -13160,18 +13163,17 @@ function () {
mgr.rotateGripConnector.setAttribute('y2', nbay - gripRadius * 5);
mgr.rotateGrip.setAttribute('cx', nbax + nbaw / 2);
mgr.rotateGrip.setAttribute('cy', nbay - gripRadius * 5); // }
}
}]);
} // STATIC methods
return Selector;
}();
/**
* Updates cursors for corner grips on rotation so arrows point the right way.
* @param {Float} angle - Current rotation angle in degrees
* @returns {void}
*/
/**
* Updates cursors for corner grips on rotation so arrows point the right way.
* @param {Float} angle - Current rotation angle in degrees
* @returns {void}
*/
Selector.updateGripCursors = function (angle) {
}], [{
key: "updateGripCursors",
value: function updateGripCursors(angle) {
var dirArr = Object.keys(selectorManager_.selectorGrips);
var steps = Math.round(angle / 45);
@ -13187,12 +13189,15 @@ Selector.updateGripCursors = function (angle) {
Object.values(selectorManager_.selectorGrips).forEach(function (gripElement, i) {
gripElement.setAttribute('style', 'cursor:' + dirArr[i] + '-resize');
});
};
}
}]);
return Selector;
}();
/**
* Manage all selector objects (selection boxes).
*/
var SelectorManager =
/*#__PURE__*/
function () {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

65
dist/index-umd.js vendored
View File

@ -2565,6 +2565,22 @@
}
return builder.pathSegList;
} // STATIC
}], [{
key: "_pathSegArrayAsString",
value: function _pathSegArrayAsString(pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}
}]);
@ -2579,24 +2595,9 @@
return this._list.length;
},
enumerable: true
});
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}; // Add the pathSegList accessors to SVGPathElement.
}); // Add the pathSegList accessors to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
Object.defineProperties(SVGPathElement.prototype, {
pathSegList: {
get: function get() {
@ -6322,17 +6323,16 @@
grips: grips,
closedSubpath: closedSubpath
});
}
}]);
} // STATIC
return Path;
}();
/**
* @param {Integer} index
* @returns {boolean}
*/
Path.subpathIsClosed = function (index) {
}], [{
key: "subpathIsClosed",
value: function subpathIsClosed(index) {
var clsd = false; // Check if subpath is already open
path.eachSeg(function (i) {
@ -6354,14 +6354,17 @@
return true;
});
return clsd;
};
}
}]);
return Path;
}();
/**
* @function module:path.getPath_
* @param {SVGPathElement} elem
* @returns {module:path.Path}
*/
var getPath_ = function getPath_(elem) {
var p = pathData[elem.id];
@ -13166,18 +13169,17 @@
mgr.rotateGripConnector.setAttribute('y2', nbay - gripRadius * 5);
mgr.rotateGrip.setAttribute('cx', nbax + nbaw / 2);
mgr.rotateGrip.setAttribute('cy', nbay - gripRadius * 5); // }
}
}]);
} // STATIC methods
return Selector;
}();
/**
* Updates cursors for corner grips on rotation so arrows point the right way.
* @param {Float} angle - Current rotation angle in degrees
* @returns {void}
*/
Selector.updateGripCursors = function (angle) {
}], [{
key: "updateGripCursors",
value: function updateGripCursors(angle) {
var dirArr = Object.keys(selectorManager_.selectorGrips);
var steps = Math.round(angle / 45);
@ -13193,12 +13195,15 @@
Object.values(selectorManager_.selectorGrips).forEach(function (gripElement, i) {
gripElement.setAttribute('style', 'cursor:' + dirArr[i] + '-resize');
});
};
}
}]);
return Selector;
}();
/**
* Manage all selector objects (selection boxes).
*/
var SelectorManager =
/*#__PURE__*/
function () {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -364,12 +364,14 @@
return '#' + r + g + b;
}
}]);
/**
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
return RGBColor;
}();
RGBColor.getHelpXML = function () {
}], [{
key: "getHelpXML",
value: function getHelpXML() {
var examples = [].concat(_toConsumableArray(colorDefs.flatMap(function (_ref2) {
var example = _ref2.example;
return example;
@ -381,7 +383,7 @@
var listItem = document.createElement('li');
var listColor = new RGBColor(example);
var exampleDiv = document.createElement('div');
exampleDiv.style.cssText = "\nmargin: 3px;\nborder: 1px solid black;\nbackground: ".concat(listColor.toHex(), ";\ncolor: ").concat(listColor.toHex(), ";");
exampleDiv.style.cssText = "\n margin: 3px;\n border: 1px solid black;\n background: ".concat(listColor.toHex(), ";\n color: ").concat(listColor.toHex(), ";");
exampleDiv.append('test');
var listItemValue = " ".concat(example, " -> ").concat(listColor.toRGB(), " -> ").concat(listColor.toHex());
listItem.append(exampleDiv, listItemValue);
@ -391,7 +393,11 @@
}
})));
return xml;
};
}
}]);
return RGBColor;
}();
var jsPDFAPI = jsPDF.API;
var pdfSvgAttr = {

View File

@ -2343,6 +2343,22 @@
}
return builder.pathSegList;
} // STATIC
}], [{
key: "_pathSegArrayAsString",
value: function _pathSegArrayAsString(pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}
}]);
@ -2357,24 +2373,9 @@
return this._list.length;
},
enumerable: true
});
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}; // Add the pathSegList accessors to SVGPathElement.
}); // Add the pathSegList accessors to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
Object.defineProperties(SVGPathElement.prototype, {
pathSegList: {
get: function get() {

View File

@ -2437,6 +2437,22 @@ var SvgCanvas = (function () {
}
return builder.pathSegList;
} // STATIC
}], [{
key: "_pathSegArrayAsString",
value: function _pathSegArrayAsString(pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}
}]);
@ -2451,24 +2467,9 @@ var SvgCanvas = (function () {
return this._list.length;
},
enumerable: true
});
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}; // Add the pathSegList accessors to SVGPathElement.
}); // Add the pathSegList accessors to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
Object.defineProperties(SVGPathElement.prototype, {
pathSegList: {
get: function get() {
@ -6388,17 +6389,16 @@ var SvgCanvas = (function () {
grips: grips,
closedSubpath: closedSubpath
});
}
}]);
} // STATIC
return Path;
}();
/**
* @param {Integer} index
* @returns {boolean}
*/
Path.subpathIsClosed = function (index) {
}], [{
key: "subpathIsClosed",
value: function subpathIsClosed(index) {
var clsd = false; // Check if subpath is already open
path.eachSeg(function (i) {
@ -6420,14 +6420,17 @@ var SvgCanvas = (function () {
return true;
});
return clsd;
};
}
}]);
return Path;
}();
/**
* @function module:path.getPath_
* @param {SVGPathElement} elem
* @returns {module:path.Path}
*/
var getPath_ = function getPath_(elem) {
var p = pathData[elem.id];
@ -12938,18 +12941,17 @@ var SvgCanvas = (function () {
mgr.rotateGripConnector.setAttribute('y2', nbay - gripRadius * 5);
mgr.rotateGrip.setAttribute('cx', nbax + nbaw / 2);
mgr.rotateGrip.setAttribute('cy', nbay - gripRadius * 5); // }
}
}]);
} // STATIC methods
return Selector;
}();
/**
* Updates cursors for corner grips on rotation so arrows point the right way.
* @param {Float} angle - Current rotation angle in degrees
* @returns {void}
*/
Selector.updateGripCursors = function (angle) {
}], [{
key: "updateGripCursors",
value: function updateGripCursors(angle) {
var dirArr = Object.keys(selectorManager_.selectorGrips);
var steps = Math.round(angle / 45);
@ -12965,12 +12967,15 @@ var SvgCanvas = (function () {
Object.values(selectorManager_.selectorGrips).forEach(function (gripElement, i) {
gripElement.setAttribute('style', 'cursor:' + dirArr[i] + '-resize');
});
};
}
}]);
return Selector;
}();
/**
* Manage all selector objects (selection boxes).
*/
var SelectorManager =
/*#__PURE__*/
function () {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -238,13 +238,12 @@ export default class RGBColor {
if (b.length === 1) { b = '0' + b; }
return '#' + r + g + b;
}
}
/**
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
RGBColor.getHelpXML = function () {
/**
* Offers a bulleted list of help.
* @returns {HTMLUListElement}
*/
static getHelpXML () {
const examples = [
// add regexps
...colorDefs.flatMap(({example}) => {
@ -263,10 +262,10 @@ RGBColor.getHelpXML = function () {
const listColor = new RGBColor(example);
const exampleDiv = document.createElement('div');
exampleDiv.style.cssText = `
margin: 3px;
border: 1px solid black;
background: ${listColor.toHex()};
color: ${listColor.toHex()};`;
margin: 3px;
border: 1px solid black;
background: ${listColor.toHex()};
color: ${listColor.toHex()};`;
exampleDiv.append('test');
const listItemValue = ` ${example} -> ${listColor.toRGB()} -> ${listColor.toHex()}`;
listItem.append(exampleDiv, listItemValue);
@ -276,4 +275,5 @@ color: ${listColor.toHex()};`;
}
}));
return xml;
};
}
}

View File

@ -1305,13 +1305,13 @@ export class Path {
const closedSubpath = Path.subpathIsClosed(this.selected_pts[0]);
editorContext_.addPtsToSelection({grips, closedSubpath});
}
}
/**
* @param {Integer} index
* @returns {boolean}
*/
Path.subpathIsClosed = function (index) {
// STATIC
/**
* @param {Integer} index
* @returns {boolean}
*/
static subpathIsClosed (index) {
let clsd = false;
// Check if subpath is already open
path.eachSeg(function (i) {
@ -1329,7 +1329,8 @@ Path.subpathIsClosed = function (index) {
});
return clsd;
};
}
}
/**
* @function module:path.getPath_

View File

@ -236,13 +236,14 @@ export class Selector {
mgr.rotateGrip.setAttribute('cy', nbay - (gripRadius * 5));
// }
}
}
/**
* Updates cursors for corner grips on rotation so arrows point the right way.
* @param {Float} angle - Current rotation angle in degrees
* @returns {void}
*/
Selector.updateGripCursors = function (angle) {
// STATIC methods
/**
* Updates cursors for corner grips on rotation so arrows point the right way.
* @param {Float} angle - Current rotation angle in degrees
* @returns {void}
*/
static updateGripCursors (angle) {
const dirArr = Object.keys(selectorManager_.selectorGrips);
let steps = Math.round(angle / 45);
if (steps < 0) { steps += 8; }
@ -253,7 +254,8 @@ Selector.updateGripCursors = function (angle) {
Object.values(selectorManager_.selectorGrips).forEach((gripElement, i) => {
gripElement.setAttribute('style', ('cursor:' + dirArr[i] + '-resize'));
});
};
}
}
/**
* Manage all selector objects (selection boxes).

View File

@ -922,19 +922,9 @@ if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.pro
return builder.pathSegList;
}
}
SVGPathSegList.prototype.classname = 'SVGPathSegList';
Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {
get () {
this._checkPathSynchronizedToList();
return this._list.length;
},
enumerable: true
});
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
// STATIC
static _pathSegArrayAsString (pathSegArray) {
let string = '';
let first = true;
pathSegArray.forEach((pathSeg) => {
@ -946,7 +936,18 @@ if (!('SVGPathSegList' in window) || !('appendItem' in window.SVGPathSegList.pro
}
});
return string;
};
}
}
SVGPathSegList.prototype.classname = 'SVGPathSegList';
Object.defineProperty(SVGPathSegList.prototype, 'numberOfItems', {
get () {
this._checkPathSynchronizedToList();
return this._list.length;
},
enumerable: true
});
// Add the pathSegList accessors to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData

View File

@ -120,7 +120,7 @@ let listMap_ = {};
* implementing as much of SVGTransformList that we need to get the job done.
* @implements {module:SVGTransformList.SVGEditTransformList}
*/
export class SVGTransformList {// eslint-disable-line no-shadow
export class SVGTransformList { // eslint-disable-line no-shadow
/**
* @param {Element} elem
*/

View File

@ -2562,6 +2562,22 @@
}
return builder.pathSegList;
} // STATIC
}], [{
key: "_pathSegArrayAsString",
value: function _pathSegArrayAsString(pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}
}]);
@ -2576,24 +2592,9 @@
return this._list.length;
},
enumerable: true
});
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}; // Add the pathSegList accessors to SVGPathElement.
}); // Add the pathSegList accessors to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
Object.defineProperties(SVGPathElement.prototype, {
pathSegList: {
get: function get() {
@ -6319,17 +6320,16 @@
grips: grips,
closedSubpath: closedSubpath
});
}
}]);
} // STATIC
return Path;
}();
/**
* @param {Integer} index
* @returns {boolean}
*/
Path.subpathIsClosed = function (index) {
}], [{
key: "subpathIsClosed",
value: function subpathIsClosed(index) {
var clsd = false; // Check if subpath is already open
path.eachSeg(function (i) {
@ -6351,14 +6351,17 @@
return true;
});
return clsd;
};
}
}]);
return Path;
}();
/**
* @function module:path.getPath_
* @param {SVGPathElement} elem
* @returns {module:path.Path}
*/
var getPath_ = function getPath_(elem) {
var p = pathData[elem.id];
@ -13163,18 +13166,17 @@
mgr.rotateGripConnector.setAttribute('y2', nbay - gripRadius * 5);
mgr.rotateGrip.setAttribute('cx', nbax + nbaw / 2);
mgr.rotateGrip.setAttribute('cy', nbay - gripRadius * 5); // }
}
}]);
} // STATIC methods
return Selector;
}();
/**
* Updates cursors for corner grips on rotation so arrows point the right way.
* @param {Float} angle - Current rotation angle in degrees
* @returns {void}
*/
Selector.updateGripCursors = function (angle) {
}], [{
key: "updateGripCursors",
value: function updateGripCursors(angle) {
var dirArr = Object.keys(selectorManager_.selectorGrips);
var steps = Math.round(angle / 45);
@ -13190,12 +13192,15 @@
Object.values(selectorManager_.selectorGrips).forEach(function (gripElement, i) {
gripElement.setAttribute('style', 'cursor:' + dirArr[i] + '-resize');
});
};
}
}]);
return Selector;
}();
/**
* Manage all selector objects (selection boxes).
*/
var SelectorManager =
/*#__PURE__*/
function () {

View File

@ -2562,6 +2562,22 @@
}
return builder.pathSegList;
} // STATIC
}], [{
key: "_pathSegArrayAsString",
value: function _pathSegArrayAsString(pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}
}]);
@ -2576,24 +2592,9 @@
return this._list.length;
},
enumerable: true
});
SVGPathSegList._pathSegArrayAsString = function (pathSegArray) {
var string = '';
var first = true;
pathSegArray.forEach(function (pathSeg) {
if (first) {
first = false;
string += pathSeg._asPathString();
} else {
string += ' ' + pathSeg._asPathString();
}
});
return string;
}; // Add the pathSegList accessors to SVGPathElement.
}); // Add the pathSegList accessors to SVGPathElement.
// Spec: https://www.w3.org/TR/SVG11/single-page.html#paths-InterfaceSVGAnimatedPathData
Object.defineProperties(SVGPathElement.prototype, {
pathSegList: {
get: function get() {
@ -6319,17 +6320,16 @@
grips: grips,
closedSubpath: closedSubpath
});
}
}]);
} // STATIC
return Path;
}();
/**
* @param {Integer} index
* @returns {boolean}
*/
Path.subpathIsClosed = function (index) {
}], [{
key: "subpathIsClosed",
value: function subpathIsClosed(index) {
var clsd = false; // Check if subpath is already open
path.eachSeg(function (i) {
@ -6351,14 +6351,17 @@
return true;
});
return clsd;
};
}
}]);
return Path;
}();
/**
* @function module:path.getPath_
* @param {SVGPathElement} elem
* @returns {module:path.Path}
*/
var getPath_ = function getPath_(elem) {
var p = pathData[elem.id];
@ -13163,18 +13166,17 @@
mgr.rotateGripConnector.setAttribute('y2', nbay - gripRadius * 5);
mgr.rotateGrip.setAttribute('cx', nbax + nbaw / 2);
mgr.rotateGrip.setAttribute('cy', nbay - gripRadius * 5); // }
}
}]);
} // STATIC methods
return Selector;
}();
/**
* Updates cursors for corner grips on rotation so arrows point the right way.
* @param {Float} angle - Current rotation angle in degrees
* @returns {void}
*/
Selector.updateGripCursors = function (angle) {
}], [{
key: "updateGripCursors",
value: function updateGripCursors(angle) {
var dirArr = Object.keys(selectorManager_.selectorGrips);
var steps = Math.round(angle / 45);
@ -13190,12 +13192,15 @@
Object.values(selectorManager_.selectorGrips).forEach(function (gripElement, i) {
gripElement.setAttribute('style', 'cursor:' + dirArr[i] + '-resize');
});
};
}
}]);
return Selector;
}();
/**
* Manage all selector objects (selection boxes).
*/
var SelectorManager =
/*#__PURE__*/
function () {