- npm: `package-lock.json`: updated version

- Fix (Connector extension): Get config object when available
master
Brett Zamir 2018-05-28 18:49:30 +08:00
parent bfbd0a42ec
commit beb513ae0e
2 changed files with 8 additions and 5 deletions

View File

@ -12,7 +12,7 @@ import svgEditor from '../svg-editor.js';
svgEditor.addExtension('Connector', function (S) { svgEditor.addExtension('Connector', function (S) {
const $ = jQuery; const $ = jQuery;
const svgCanvas = svgEditor.canvas; const svgCanvas = svgEditor.canvas;
const {svgroot, getNextId, getElem, curConfig} = S, const {svgroot, getNextId, getElem} = S,
addElem = S.addSvgElementFromJson, addElem = S.addSvgElementFromJson,
selManager = S.selectorManager, selManager = S.selectorManager,
connSel = '.se_connector', connSel = '.se_connector',
@ -340,6 +340,7 @@ svgEditor.addExtension('Connector', function (S) {
startX = opts.start_x; startX = opts.start_x;
startY = opts.start_y; startY = opts.start_y;
const mode = svgCanvas.getMode(); const mode = svgCanvas.getMode();
const {curConfig: {initStroke}} = svgEditor;
if (mode === 'connector') { if (mode === 'connector') {
if (started) { return; } if (started) { return; }
@ -366,10 +367,12 @@ svgEditor.addExtension('Connector', function (S) {
attr: { attr: {
id: getNextId(), id: getNextId(),
points: (x + ',' + y + ' ' + x + ',' + y + ' ' + startX + ',' + startY), points: (x + ',' + y + ' ' + x + ',' + y + ' ' + startX + ',' + startY),
stroke: '#' + curConfig.initStroke.color, stroke: '#' + initStroke.color,
'stroke-width': (!startElem.stroke_width || startElem.stroke_width === 0) ? curConfig.initStroke.width : startElem.stroke_width, 'stroke-width': (!startElem.stroke_width || startElem.stroke_width === 0)
? initStroke.width
: startElem.stroke_width,
fill: 'none', fill: 'none',
opacity: curConfig.initStroke.opacity, opacity: initStroke.opacity,
style: 'pointer-events:none' style: 'pointer-events:none'
} }
}); });

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "svgedit", "name": "svgedit",
"version": "3.0.0-alpha.1", "version": "3.0.0-alpha.2",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {