#603 unwanted function removed and translate changes
This commit is contained in:
@@ -678,31 +678,6 @@ export const embedImage = function (src) {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Serializes the current drawing into SVG XML text and passes it to the 'saved' handler.
|
||||
* This function also includes the XML prolog. Clients of the `SvgCanvas` bind their save
|
||||
* function to the 'saved' event.
|
||||
* @function module:svgcanvas.SvgCanvas#save
|
||||
* @param {module:svgcanvas.SaveOptions} opts
|
||||
* @fires module:svgcanvas.SvgCanvas#event:saved
|
||||
* @returns {void}
|
||||
*/
|
||||
export const save = function (opts) {
|
||||
// remove the selected outline before serializing
|
||||
svgCanvas.clearSelection();
|
||||
// Update save options if provided
|
||||
if (opts) {
|
||||
const saveOptions = svgCanvas.mergeDeep(svgContext_.getSvgOption(), opts);
|
||||
for (const [ key, value ] of Object.entries(saveOptions)) {
|
||||
svgContext_.setSvgOption(key, value);
|
||||
}
|
||||
}
|
||||
svgContext_.setSvgOption('apply', true);
|
||||
|
||||
// no need for doctype, see https://jwatt.org/svg/authoring/#doctype-declaration
|
||||
const str = svgCanvas.svgCanvasToString();
|
||||
svgContext_.call('saved', str);
|
||||
};
|
||||
/**
|
||||
* @typedef {PlainObject} module:svgcanvas.IssuesAndCodes
|
||||
* @property {string[]} issueCodes The locale-independent code names
|
||||
|
||||
@@ -80,7 +80,7 @@ import {
|
||||
convertToNum, getTypeMap, init as unitsInit
|
||||
} from '../common/units.js';
|
||||
import {
|
||||
svgCanvasToString, svgToString, setSvgString, save, exportPDF, setUseDataMethod,
|
||||
svgCanvasToString, svgToString, setSvgString, exportPDF, setUseDataMethod,
|
||||
init as svgInit, importSvgString, embedImage, rasterExport,
|
||||
uniquifyElemsMethod, removeUnusedDefElemsMethod, convertGradientsMethod
|
||||
} from './svg-exec.js';
|
||||
@@ -1452,26 +1452,6 @@ class SvgCanvas {
|
||||
lastGoodImgUrl = val;
|
||||
};
|
||||
|
||||
/**
|
||||
* Does nothing by default, handled by optional widget/extension.
|
||||
* @function module:svgcanvas.SvgCanvas#open
|
||||
* @returns {void}
|
||||
*/
|
||||
this.open = function () {
|
||||
/* empty fn */
|
||||
};
|
||||
|
||||
/**
|
||||
* Serializes the current drawing into SVG XML text and passes it to the 'saved' handler.
|
||||
* This function also includes the XML prolog. Clients of the `SvgCanvas` bind their save
|
||||
* function to the 'saved' event.
|
||||
* @function module:svgcanvas.SvgCanvas#save
|
||||
* @param {module:svgcanvas.SaveOptions} opts
|
||||
* @fires module:svgcanvas.SvgCanvas#event:saved
|
||||
* @returns {void}
|
||||
*/
|
||||
this.save = save;
|
||||
|
||||
/**
|
||||
* @typedef {PlainObject} module:svgcanvas.IssuesAndCodes
|
||||
* @property {string[]} issueCodes The locale-independent code names
|
||||
|
||||
Reference in New Issue
Block a user