- Update dist files

master
Brett Zamir 2018-07-26 00:06:38 -07:00
parent e2d378cfe6
commit b4d7b221e0
12 changed files with 107 additions and 93 deletions

35
dist/canvg.js vendored
View File

@ -1668,6 +1668,7 @@ var canvg = (function (exports) {
classCallCheck(this, _class4);
this.captureTextNodes = arguments[1]; // Argument from inheriting class
this.attributes = {};
this.styles = {};
this.children = [];
@ -2851,7 +2852,8 @@ var canvg = (function (exports) {
createClass(_class19, [{
key: 'getGradient',
value: function getGradient(ctx, element) {
var bb = this.gradientUnits === 'objectBoundingBox' ? element.getBoundingBox() : null;
var useBB = this.gradientUnits === 'objectBoundingBox' && element.getBoundingBox;
var bb = useBB ? element.getBoundingBox() : null;
if (!this.attribute('x1').hasValue() && !this.attribute('y1').hasValue() && !this.attribute('x2').hasValue() && !this.attribute('y2').hasValue()) {
this.attribute('x1', true).value = 0;
@ -2860,10 +2862,10 @@ var canvg = (function (exports) {
this.attribute('y2', true).value = 0;
}
var x1 = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('x1').numValue() : this.attribute('x1').toPixels('x');
var y1 = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('y1').numValue() : this.attribute('y1').toPixels('y');
var x2 = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('x2').numValue() : this.attribute('x2').toPixels('x');
var y2 = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('y2').numValue() : this.attribute('y2').toPixels('y');
var x1 = useBB ? bb.x() + bb.width() * this.attribute('x1').numValue() : this.attribute('x1').toPixels('x');
var y1 = useBB ? bb.y() + bb.height() * this.attribute('y1').numValue() : this.attribute('y1').toPixels('y');
var x2 = useBB ? bb.x() + bb.width() * this.attribute('x2').numValue() : this.attribute('x2').toPixels('x');
var y2 = useBB ? bb.y() + bb.height() * this.attribute('y2').numValue() : this.attribute('y2').toPixels('y');
if (x1 === x2 && y1 === y2) return null;
return ctx.createLinearGradient(x1, y1, x2, y2);
@ -2884,25 +2886,26 @@ var canvg = (function (exports) {
createClass(_class20, [{
key: 'getGradient',
value: function getGradient(ctx, element) {
var bb = element.getBoundingBox();
var useBB = this.gradientUnits === 'objectBoundingBox' && element.getBoundingBox;
var bb = useBB ? element.getBoundingBox() : null;
if (!this.attribute('cx').hasValue()) this.attribute('cx', true).value = '50%';
if (!this.attribute('cy').hasValue()) this.attribute('cy', true).value = '50%';
if (!this.attribute('r').hasValue()) this.attribute('r', true).value = '50%';
var cx = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('cx').numValue() : this.attribute('cx').toPixels('x');
var cy = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('cy').numValue() : this.attribute('cy').toPixels('y');
var cx = useBB ? bb.x() + bb.width() * this.attribute('cx').numValue() : this.attribute('cx').toPixels('x');
var cy = useBB ? bb.y() + bb.height() * this.attribute('cy').numValue() : this.attribute('cy').toPixels('y');
var fx = cx;
var fy = cy;
if (this.attribute('fx').hasValue()) {
fx = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('fx').numValue() : this.attribute('fx').toPixels('x');
fx = useBB ? bb.x() + bb.width() * this.attribute('fx').numValue() : this.attribute('fx').toPixels('x');
}
if (this.attribute('fy').hasValue()) {
fy = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('fy').numValue() : this.attribute('fy').toPixels('y');
fy = useBB ? bb.y() + bb.height() * this.attribute('fy').numValue() : this.attribute('fy').toPixels('y');
}
var r = this.gradientUnits === 'objectBoundingBox' ? (bb.width() + bb.height()) / 2.0 * this.attribute('r').numValue() : this.attribute('r').toPixels();
var r = useBB ? (bb.width() + bb.height()) / 2.0 * this.attribute('r').numValue() : this.attribute('r').toPixels();
return ctx.createRadialGradient(fx, fy, 0, cx, cy, r);
}
@ -3224,11 +3227,7 @@ var canvg = (function (exports) {
function _class30(node) {
classCallCheck(this, _class30);
var _this33 = possibleConstructorReturn(this, (_class30.__proto__ || Object.getPrototypeOf(_class30)).call(this, node));
_this33.captureTextNodes = true;
return _this33;
return possibleConstructorReturn(this, (_class30.__proto__ || Object.getPrototypeOf(_class30)).call(this, node, true));
}
createClass(_class30, [{
@ -3431,9 +3430,7 @@ var canvg = (function (exports) {
function _class32(node) {
classCallCheck(this, _class32);
var _this36 = possibleConstructorReturn(this, (_class32.__proto__ || Object.getPrototypeOf(_class32)).call(this, node));
_this36.captureTextNodes = true;
var _this36 = possibleConstructorReturn(this, (_class32.__proto__ || Object.getPrototypeOf(_class32)).call(this, node, true));
_this36.text = node.nodeValue || node.text || '';
return _this36;

View File

@ -464,7 +464,7 @@ var svgEditorExtension_markers = (function () {
// note - to add additional marker types add them below with a unique id
// and add the associated icon(s) to marker-icons.svg
// the geometry is normallized to a 100x100 box with the origin at lower left
// the geometry is normalized to a 100x100 box with the origin at lower left
// Safari did not like negative values for low left of viewBox
// remember that the coordinate system has +y downward

View File

@ -1645,6 +1645,7 @@ var svgEditorExtension_server_moinsave = (function () {
classCallCheck(this, _class4);
this.captureTextNodes = arguments[1]; // Argument from inheriting class
this.attributes = {};
this.styles = {};
this.children = [];
@ -2828,7 +2829,8 @@ var svgEditorExtension_server_moinsave = (function () {
createClass(_class19, [{
key: 'getGradient',
value: function getGradient(ctx, element) {
var bb = this.gradientUnits === 'objectBoundingBox' ? element.getBoundingBox() : null;
var useBB = this.gradientUnits === 'objectBoundingBox' && element.getBoundingBox;
var bb = useBB ? element.getBoundingBox() : null;
if (!this.attribute('x1').hasValue() && !this.attribute('y1').hasValue() && !this.attribute('x2').hasValue() && !this.attribute('y2').hasValue()) {
this.attribute('x1', true).value = 0;
@ -2837,10 +2839,10 @@ var svgEditorExtension_server_moinsave = (function () {
this.attribute('y2', true).value = 0;
}
var x1 = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('x1').numValue() : this.attribute('x1').toPixels('x');
var y1 = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('y1').numValue() : this.attribute('y1').toPixels('y');
var x2 = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('x2').numValue() : this.attribute('x2').toPixels('x');
var y2 = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('y2').numValue() : this.attribute('y2').toPixels('y');
var x1 = useBB ? bb.x() + bb.width() * this.attribute('x1').numValue() : this.attribute('x1').toPixels('x');
var y1 = useBB ? bb.y() + bb.height() * this.attribute('y1').numValue() : this.attribute('y1').toPixels('y');
var x2 = useBB ? bb.x() + bb.width() * this.attribute('x2').numValue() : this.attribute('x2').toPixels('x');
var y2 = useBB ? bb.y() + bb.height() * this.attribute('y2').numValue() : this.attribute('y2').toPixels('y');
if (x1 === x2 && y1 === y2) return null;
return ctx.createLinearGradient(x1, y1, x2, y2);
@ -2861,25 +2863,26 @@ var svgEditorExtension_server_moinsave = (function () {
createClass(_class20, [{
key: 'getGradient',
value: function getGradient(ctx, element) {
var bb = element.getBoundingBox();
var useBB = this.gradientUnits === 'objectBoundingBox' && element.getBoundingBox;
var bb = useBB ? element.getBoundingBox() : null;
if (!this.attribute('cx').hasValue()) this.attribute('cx', true).value = '50%';
if (!this.attribute('cy').hasValue()) this.attribute('cy', true).value = '50%';
if (!this.attribute('r').hasValue()) this.attribute('r', true).value = '50%';
var cx = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('cx').numValue() : this.attribute('cx').toPixels('x');
var cy = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('cy').numValue() : this.attribute('cy').toPixels('y');
var cx = useBB ? bb.x() + bb.width() * this.attribute('cx').numValue() : this.attribute('cx').toPixels('x');
var cy = useBB ? bb.y() + bb.height() * this.attribute('cy').numValue() : this.attribute('cy').toPixels('y');
var fx = cx;
var fy = cy;
if (this.attribute('fx').hasValue()) {
fx = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('fx').numValue() : this.attribute('fx').toPixels('x');
fx = useBB ? bb.x() + bb.width() * this.attribute('fx').numValue() : this.attribute('fx').toPixels('x');
}
if (this.attribute('fy').hasValue()) {
fy = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('fy').numValue() : this.attribute('fy').toPixels('y');
fy = useBB ? bb.y() + bb.height() * this.attribute('fy').numValue() : this.attribute('fy').toPixels('y');
}
var r = this.gradientUnits === 'objectBoundingBox' ? (bb.width() + bb.height()) / 2.0 * this.attribute('r').numValue() : this.attribute('r').toPixels();
var r = useBB ? (bb.width() + bb.height()) / 2.0 * this.attribute('r').numValue() : this.attribute('r').toPixels();
return ctx.createRadialGradient(fx, fy, 0, cx, cy, r);
}
@ -3201,11 +3204,7 @@ var svgEditorExtension_server_moinsave = (function () {
function _class30(node) {
classCallCheck(this, _class30);
var _this33 = possibleConstructorReturn(this, (_class30.__proto__ || Object.getPrototypeOf(_class30)).call(this, node));
_this33.captureTextNodes = true;
return _this33;
return possibleConstructorReturn(this, (_class30.__proto__ || Object.getPrototypeOf(_class30)).call(this, node, true));
}
createClass(_class30, [{
@ -3408,9 +3407,7 @@ var svgEditorExtension_server_moinsave = (function () {
function _class32(node) {
classCallCheck(this, _class32);
var _this36 = possibleConstructorReturn(this, (_class32.__proto__ || Object.getPrototypeOf(_class32)).call(this, node));
_this36.captureTextNodes = true;
var _this36 = possibleConstructorReturn(this, (_class32.__proto__ || Object.getPrototypeOf(_class32)).call(this, node, true));
_this36.text = node.nodeValue || node.text || '';
return _this36;

View File

@ -1645,6 +1645,7 @@ var svgEditorExtension_server_opensave = (function () {
classCallCheck(this, _class4);
this.captureTextNodes = arguments[1]; // Argument from inheriting class
this.attributes = {};
this.styles = {};
this.children = [];
@ -2828,7 +2829,8 @@ var svgEditorExtension_server_opensave = (function () {
createClass(_class19, [{
key: 'getGradient',
value: function getGradient(ctx, element) {
var bb = this.gradientUnits === 'objectBoundingBox' ? element.getBoundingBox() : null;
var useBB = this.gradientUnits === 'objectBoundingBox' && element.getBoundingBox;
var bb = useBB ? element.getBoundingBox() : null;
if (!this.attribute('x1').hasValue() && !this.attribute('y1').hasValue() && !this.attribute('x2').hasValue() && !this.attribute('y2').hasValue()) {
this.attribute('x1', true).value = 0;
@ -2837,10 +2839,10 @@ var svgEditorExtension_server_opensave = (function () {
this.attribute('y2', true).value = 0;
}
var x1 = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('x1').numValue() : this.attribute('x1').toPixels('x');
var y1 = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('y1').numValue() : this.attribute('y1').toPixels('y');
var x2 = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('x2').numValue() : this.attribute('x2').toPixels('x');
var y2 = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('y2').numValue() : this.attribute('y2').toPixels('y');
var x1 = useBB ? bb.x() + bb.width() * this.attribute('x1').numValue() : this.attribute('x1').toPixels('x');
var y1 = useBB ? bb.y() + bb.height() * this.attribute('y1').numValue() : this.attribute('y1').toPixels('y');
var x2 = useBB ? bb.x() + bb.width() * this.attribute('x2').numValue() : this.attribute('x2').toPixels('x');
var y2 = useBB ? bb.y() + bb.height() * this.attribute('y2').numValue() : this.attribute('y2').toPixels('y');
if (x1 === x2 && y1 === y2) return null;
return ctx.createLinearGradient(x1, y1, x2, y2);
@ -2861,25 +2863,26 @@ var svgEditorExtension_server_opensave = (function () {
createClass(_class20, [{
key: 'getGradient',
value: function getGradient(ctx, element) {
var bb = element.getBoundingBox();
var useBB = this.gradientUnits === 'objectBoundingBox' && element.getBoundingBox;
var bb = useBB ? element.getBoundingBox() : null;
if (!this.attribute('cx').hasValue()) this.attribute('cx', true).value = '50%';
if (!this.attribute('cy').hasValue()) this.attribute('cy', true).value = '50%';
if (!this.attribute('r').hasValue()) this.attribute('r', true).value = '50%';
var cx = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('cx').numValue() : this.attribute('cx').toPixels('x');
var cy = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('cy').numValue() : this.attribute('cy').toPixels('y');
var cx = useBB ? bb.x() + bb.width() * this.attribute('cx').numValue() : this.attribute('cx').toPixels('x');
var cy = useBB ? bb.y() + bb.height() * this.attribute('cy').numValue() : this.attribute('cy').toPixels('y');
var fx = cx;
var fy = cy;
if (this.attribute('fx').hasValue()) {
fx = this.gradientUnits === 'objectBoundingBox' ? bb.x() + bb.width() * this.attribute('fx').numValue() : this.attribute('fx').toPixels('x');
fx = useBB ? bb.x() + bb.width() * this.attribute('fx').numValue() : this.attribute('fx').toPixels('x');
}
if (this.attribute('fy').hasValue()) {
fy = this.gradientUnits === 'objectBoundingBox' ? bb.y() + bb.height() * this.attribute('fy').numValue() : this.attribute('fy').toPixels('y');
fy = useBB ? bb.y() + bb.height() * this.attribute('fy').numValue() : this.attribute('fy').toPixels('y');
}
var r = this.gradientUnits === 'objectBoundingBox' ? (bb.width() + bb.height()) / 2.0 * this.attribute('r').numValue() : this.attribute('r').toPixels();
var r = useBB ? (bb.width() + bb.height()) / 2.0 * this.attribute('r').numValue() : this.attribute('r').toPixels();
return ctx.createRadialGradient(fx, fy, 0, cx, cy, r);
}
@ -3201,11 +3204,7 @@ var svgEditorExtension_server_opensave = (function () {
function _class30(node) {
classCallCheck(this, _class30);
var _this33 = possibleConstructorReturn(this, (_class30.__proto__ || Object.getPrototypeOf(_class30)).call(this, node));
_this33.captureTextNodes = true;
return _this33;
return possibleConstructorReturn(this, (_class30.__proto__ || Object.getPrototypeOf(_class30)).call(this, node, true));
}
createClass(_class30, [{
@ -3408,9 +3407,7 @@ var svgEditorExtension_server_opensave = (function () {
function _class32(node) {
classCallCheck(this, _class32);
var _this36 = possibleConstructorReturn(this, (_class32.__proto__ || Object.getPrototypeOf(_class32)).call(this, node));
_this36.captureTextNodes = true;
var _this36 = possibleConstructorReturn(this, (_class32.__proto__ || Object.getPrototypeOf(_class32)).call(this, node, true));
_this36.text = node.nodeValue || node.text || '';
return _this36;

27
dist/index-es.js vendored
View File

@ -14748,9 +14748,13 @@ function SvgCanvas(container, config) {
bSpline = getBsplinePoint(parameter);
sumDistance += Math.sqrt((nextPos.x - bSpline.x) * (nextPos.x - bSpline.x) + (nextPos.y - bSpline.y) * (nextPos.y - bSpline.y));
if (sumDistance > THRESHOLD_DIST) {
dAttr += +bSpline.x + ',' + bSpline.y + ' ';
shape.setAttributeNS(null, 'points', dAttr);
sumDistance -= THRESHOLD_DIST;
// Faster than completely re-writing the points attribute.
var point = svgcontent.createSVGPoint();
point.x = bSpline.x;
point.y = bSpline.y;
shape.points.appendItem(point);
}
}
}
@ -28045,7 +28049,7 @@ editor.init = function () {
* @property {string} title The tooltip text that will appear when the user hovers over the icon. Required.
* @property {PlainObject.<string, external:jQuery.Function>|PlainObject.<"click", external:jQuery.Function>} events DOM event names with associated functions. Example: `{click () { alert('Button was clicked') } }`. Click is used with `includeWith` and `type` of "mode_flyout" (and "mode"); any events may be added if `list` is not present. Expected.
* @property {string} panel The ID of the context panel to be included, if type is "context". Required only if type is "context".
* @property {string} icon The file path to the raster version of the icon image source. Required only if no `svgicon` is supplied.
* @property {string} icon The file path to the raster version of the icon image source. Required only if no `svgicons` is supplied from [ExtensionInitResponse]{@link module:svgcanvas.ExtensionInitResponse}.
* @property {string} [svgicon] If absent, will utilize the button "id"; used to set "placement" on the `svgIcons` call
* @property {string} [list] Points to the "id" of a `context_tools` item of type "button-select" into which the button will be added as a panel list item
* @property {Integer} [position] The numeric index for placement; defaults to last position (as of the time of extension addition) if not present. For use with {@link http://api.jquery.com/eq/}.
@ -29090,14 +29094,17 @@ editor.init = function () {
* @returns {undefined}
*/
var clickClear = function clickClear() {
var dims = curConfig.dimensions;
var _curConfig$dimensions = slicedToArray(curConfig.dimensions, 2),
x = _curConfig$dimensions[0],
y = _curConfig$dimensions[1];
$$b.confirm(uiStrings$1.notification.QwantToClear, function (ok) {
if (!ok) {
return;
}
setSelectMode();
svgCanvas.clear();
svgCanvas.setResolution(dims[0], dims[1]);
svgCanvas.setResolution(x, y);
updateCanvas(true);
zoomImage();
populateLayers();
@ -29151,7 +29158,7 @@ editor.init = function () {
if (loadingURL) {
popURL = loadingURL;
} else {
popHTML = '<!DOCTYPE html><html><head><meta charset="utf-8"><title>' + str + '</title></head><body><h1>' + str + '</h1></body><html>';
popHTML = '<!DOCTYPE html><html>\n <head>\n <meta charset="utf-8">\n <title>' + str + '</title>\n </head>\n <body><h1>' + str + '</h1></body>\n <html>';
if ((typeof URL === 'undefined' ? 'undefined' : _typeof(URL)) && URL.createObjectURL) {
var blob = new Blob([popHTML], { type: 'text/html' });
popURL = URL.createObjectURL(blob);
@ -29571,7 +29578,7 @@ editor.init = function () {
var colorPicker = function colorPicker(elem) {
var picker = elem.attr('id') === 'stroke_color' ? 'stroke' : 'fill';
// const opacity = (picker == 'stroke' ? $('#stroke_opacity') : $('#fill_opacity'));
var title = picker === 'stroke' ? 'Pick a Stroke Paint and Opacity' : 'Pick a Fill Paint and Opacity';
var title = picker === 'stroke' ? uiStrings$1.ui.pick_stroke_paint_opacity : uiStrings$1.ui.pick_fill_paint_opacity;
// let wasNone = false; // Currently unused
var pos = elem.offset();
var paint = paintBox[picker].paint;
@ -29599,15 +29606,15 @@ editor.init = function () {
paintOpacity = void 0;
var cur = curConfig[type === 'fill' ? 'initFill' : 'initStroke'];
// set up gradients to be used for the buttons
var svgdocbox = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg"><rect width="16.5" height="16.5"' + ' fill="#' + cur.color + '" opacity="' + cur.opacity + '"/>' + ' <defs><linearGradient id="gradbox_"/></defs></svg>', 'text/xml');
var svgdocbox = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <rect width="16.5" height="16.5"\n fill="#' + cur.color + '" opacity="' + cur.opacity + '"/>\n <defs><linearGradient id="gradbox_"/></defs>\n </svg>', 'text/xml');
var docElem = svgdocbox.documentElement;
docElem = $$b(container)[0].appendChild(document.importNode(docElem, true));
docElem.setAttribute('width', 16.5);
this.rect = docElem.firstChild;
this.rect = docElem.firstElementChild;
this.defs = docElem.getElementsByTagName('defs')[0];
this.grad = this.defs.firstChild;
this.grad = this.defs.firstElementChild;
this.paint = new $$b.jGraduate.Paint({ solidColor: cur.color });
this.type = type;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

27
dist/index-umd.js vendored
View File

@ -14754,9 +14754,13 @@
bSpline = getBsplinePoint(parameter);
sumDistance += Math.sqrt((nextPos.x - bSpline.x) * (nextPos.x - bSpline.x) + (nextPos.y - bSpline.y) * (nextPos.y - bSpline.y));
if (sumDistance > THRESHOLD_DIST) {
dAttr += +bSpline.x + ',' + bSpline.y + ' ';
shape.setAttributeNS(null, 'points', dAttr);
sumDistance -= THRESHOLD_DIST;
// Faster than completely re-writing the points attribute.
var point = svgcontent.createSVGPoint();
point.x = bSpline.x;
point.y = bSpline.y;
shape.points.appendItem(point);
}
}
}
@ -28051,7 +28055,7 @@
* @property {string} title The tooltip text that will appear when the user hovers over the icon. Required.
* @property {PlainObject.<string, external:jQuery.Function>|PlainObject.<"click", external:jQuery.Function>} events DOM event names with associated functions. Example: `{click () { alert('Button was clicked') } }`. Click is used with `includeWith` and `type` of "mode_flyout" (and "mode"); any events may be added if `list` is not present. Expected.
* @property {string} panel The ID of the context panel to be included, if type is "context". Required only if type is "context".
* @property {string} icon The file path to the raster version of the icon image source. Required only if no `svgicon` is supplied.
* @property {string} icon The file path to the raster version of the icon image source. Required only if no `svgicons` is supplied from [ExtensionInitResponse]{@link module:svgcanvas.ExtensionInitResponse}.
* @property {string} [svgicon] If absent, will utilize the button "id"; used to set "placement" on the `svgIcons` call
* @property {string} [list] Points to the "id" of a `context_tools` item of type "button-select" into which the button will be added as a panel list item
* @property {Integer} [position] The numeric index for placement; defaults to last position (as of the time of extension addition) if not present. For use with {@link http://api.jquery.com/eq/}.
@ -29096,14 +29100,17 @@
* @returns {undefined}
*/
var clickClear = function clickClear() {
var dims = curConfig.dimensions;
var _curConfig$dimensions = slicedToArray(curConfig.dimensions, 2),
x = _curConfig$dimensions[0],
y = _curConfig$dimensions[1];
$$b.confirm(uiStrings$1.notification.QwantToClear, function (ok) {
if (!ok) {
return;
}
setSelectMode();
svgCanvas.clear();
svgCanvas.setResolution(dims[0], dims[1]);
svgCanvas.setResolution(x, y);
updateCanvas(true);
zoomImage();
populateLayers();
@ -29157,7 +29164,7 @@
if (loadingURL) {
popURL = loadingURL;
} else {
popHTML = '<!DOCTYPE html><html><head><meta charset="utf-8"><title>' + str + '</title></head><body><h1>' + str + '</h1></body><html>';
popHTML = '<!DOCTYPE html><html>\n <head>\n <meta charset="utf-8">\n <title>' + str + '</title>\n </head>\n <body><h1>' + str + '</h1></body>\n <html>';
if ((typeof URL === 'undefined' ? 'undefined' : _typeof(URL)) && URL.createObjectURL) {
var blob = new Blob([popHTML], { type: 'text/html' });
popURL = URL.createObjectURL(blob);
@ -29577,7 +29584,7 @@
var colorPicker = function colorPicker(elem) {
var picker = elem.attr('id') === 'stroke_color' ? 'stroke' : 'fill';
// const opacity = (picker == 'stroke' ? $('#stroke_opacity') : $('#fill_opacity'));
var title = picker === 'stroke' ? 'Pick a Stroke Paint and Opacity' : 'Pick a Fill Paint and Opacity';
var title = picker === 'stroke' ? uiStrings$1.ui.pick_stroke_paint_opacity : uiStrings$1.ui.pick_fill_paint_opacity;
// let wasNone = false; // Currently unused
var pos = elem.offset();
var paint = paintBox[picker].paint;
@ -29605,15 +29612,15 @@
paintOpacity = void 0;
var cur = curConfig[type === 'fill' ? 'initFill' : 'initStroke'];
// set up gradients to be used for the buttons
var svgdocbox = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg"><rect width="16.5" height="16.5"' + ' fill="#' + cur.color + '" opacity="' + cur.opacity + '"/>' + ' <defs><linearGradient id="gradbox_"/></defs></svg>', 'text/xml');
var svgdocbox = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <rect width="16.5" height="16.5"\n fill="#' + cur.color + '" opacity="' + cur.opacity + '"/>\n <defs><linearGradient id="gradbox_"/></defs>\n </svg>', 'text/xml');
var docElem = svgdocbox.documentElement;
docElem = $$b(container)[0].appendChild(document.importNode(docElem, true));
docElem.setAttribute('width', 16.5);
this.rect = docElem.firstChild;
this.rect = docElem.firstElementChild;
this.defs = docElem.getElementsByTagName('defs')[0];
this.grad = this.defs.firstChild;
this.grad = this.defs.firstElementChild;
this.paint = new $$b.jGraduate.Paint({ solidColor: cur.color });
this.type = type;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -26,7 +26,9 @@ var svgEditorLang_en = (function () {
panel_drag: 'Drag left/right to resize side panel',
quality: 'Quality:',
pathNodeTooltip: 'Drag node to move it. Double-click node to change segment type',
pathCtrlPtTooltip: 'Drag control point to adjust curve properties'
pathCtrlPtTooltip: 'Drag control point to adjust curve properties',
pick_stroke_paint_opacity: 'Pick a Stroke Paint and Opacity',
pick_fill_paint_opacity: 'Pick a Fill Paint and Opacity'
},
properties: {
id: 'id',

View File

@ -14751,9 +14751,13 @@
bSpline = getBsplinePoint(parameter);
sumDistance += Math.sqrt((nextPos.x - bSpline.x) * (nextPos.x - bSpline.x) + (nextPos.y - bSpline.y) * (nextPos.y - bSpline.y));
if (sumDistance > THRESHOLD_DIST) {
dAttr += +bSpline.x + ',' + bSpline.y + ' ';
shape.setAttributeNS(null, 'points', dAttr);
sumDistance -= THRESHOLD_DIST;
// Faster than completely re-writing the points attribute.
var point = svgcontent.createSVGPoint();
point.x = bSpline.x;
point.y = bSpline.y;
shape.points.appendItem(point);
}
}
}
@ -28048,7 +28052,7 @@
* @property {string} title The tooltip text that will appear when the user hovers over the icon. Required.
* @property {PlainObject.<string, external:jQuery.Function>|PlainObject.<"click", external:jQuery.Function>} events DOM event names with associated functions. Example: `{click () { alert('Button was clicked') } }`. Click is used with `includeWith` and `type` of "mode_flyout" (and "mode"); any events may be added if `list` is not present. Expected.
* @property {string} panel The ID of the context panel to be included, if type is "context". Required only if type is "context".
* @property {string} icon The file path to the raster version of the icon image source. Required only if no `svgicon` is supplied.
* @property {string} icon The file path to the raster version of the icon image source. Required only if no `svgicons` is supplied from [ExtensionInitResponse]{@link module:svgcanvas.ExtensionInitResponse}.
* @property {string} [svgicon] If absent, will utilize the button "id"; used to set "placement" on the `svgIcons` call
* @property {string} [list] Points to the "id" of a `context_tools` item of type "button-select" into which the button will be added as a panel list item
* @property {Integer} [position] The numeric index for placement; defaults to last position (as of the time of extension addition) if not present. For use with {@link http://api.jquery.com/eq/}.
@ -29093,14 +29097,17 @@
* @returns {undefined}
*/
var clickClear = function clickClear() {
var dims = curConfig.dimensions;
var _curConfig$dimensions = slicedToArray(curConfig.dimensions, 2),
x = _curConfig$dimensions[0],
y = _curConfig$dimensions[1];
$$b.confirm(uiStrings$1.notification.QwantToClear, function (ok) {
if (!ok) {
return;
}
setSelectMode();
svgCanvas.clear();
svgCanvas.setResolution(dims[0], dims[1]);
svgCanvas.setResolution(x, y);
updateCanvas(true);
zoomImage();
populateLayers();
@ -29154,7 +29161,7 @@
if (loadingURL) {
popURL = loadingURL;
} else {
popHTML = '<!DOCTYPE html><html><head><meta charset="utf-8"><title>' + str + '</title></head><body><h1>' + str + '</h1></body><html>';
popHTML = '<!DOCTYPE html><html>\n <head>\n <meta charset="utf-8">\n <title>' + str + '</title>\n </head>\n <body><h1>' + str + '</h1></body>\n <html>';
if ((typeof URL === 'undefined' ? 'undefined' : _typeof(URL)) && URL.createObjectURL) {
var blob = new Blob([popHTML], { type: 'text/html' });
popURL = URL.createObjectURL(blob);
@ -29574,7 +29581,7 @@
var colorPicker = function colorPicker(elem) {
var picker = elem.attr('id') === 'stroke_color' ? 'stroke' : 'fill';
// const opacity = (picker == 'stroke' ? $('#stroke_opacity') : $('#fill_opacity'));
var title = picker === 'stroke' ? 'Pick a Stroke Paint and Opacity' : 'Pick a Fill Paint and Opacity';
var title = picker === 'stroke' ? uiStrings$1.ui.pick_stroke_paint_opacity : uiStrings$1.ui.pick_fill_paint_opacity;
// let wasNone = false; // Currently unused
var pos = elem.offset();
var paint = paintBox[picker].paint;
@ -29602,15 +29609,15 @@
paintOpacity = void 0;
var cur = curConfig[type === 'fill' ? 'initFill' : 'initStroke'];
// set up gradients to be used for the buttons
var svgdocbox = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg"><rect width="16.5" height="16.5"' + ' fill="#' + cur.color + '" opacity="' + cur.opacity + '"/>' + ' <defs><linearGradient id="gradbox_"/></defs></svg>', 'text/xml');
var svgdocbox = new DOMParser().parseFromString('<svg xmlns="http://www.w3.org/2000/svg">\n <rect width="16.5" height="16.5"\n fill="#' + cur.color + '" opacity="' + cur.opacity + '"/>\n <defs><linearGradient id="gradbox_"/></defs>\n </svg>', 'text/xml');
var docElem = svgdocbox.documentElement;
docElem = $$b(container)[0].appendChild(document.importNode(docElem, true));
docElem.setAttribute('width', 16.5);
this.rect = docElem.firstChild;
this.rect = docElem.firstElementChild;
this.defs = docElem.getElementsByTagName('defs')[0];
this.grad = this.defs.firstChild;
this.grad = this.defs.firstElementChild;
this.paint = new $$b.jGraduate.Paint({ solidColor: cur.color });
this.type = type;