From 60b60ecaef806ba5bd2257869406fc0b894c3c99 Mon Sep 17 00:00:00 2001 From: JFH <20402845+jfhenon@users.noreply.github.com> Date: Tue, 19 Oct 2021 08:32:35 +0200 Subject: [PATCH] fix updateReferences --- src/editor/extensions/ext-markers/ext-markers.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/editor/extensions/ext-markers/ext-markers.js b/src/editor/extensions/ext-markers/ext-markers.js index 21de1cfb..d1c0592b 100644 --- a/src/editor/extensions/ext-markers/ext-markers.js +++ b/src/editor/extensions/ext-markers/ext-markers.js @@ -254,7 +254,6 @@ export default { const updateReferences = (el) => { const selElems = svgCanvas.getSelectedElems(); mtypes.forEach((pos) => { - const id = 'mkr_' + pos + '_' + el.id; const markerName = 'marker-' + pos; const marker = getLinked(el, markerName); if (!marker || !marker.attributes.se_type) { return; } // not created by this extension @@ -263,10 +262,9 @@ export default { const len = el.id.length; const linkid = url.substr(-len - 1, len); if (el.id !== linkid) { - const val = $id(pos + '_marker').getAttribute('value'); - addMarker(id, val); - svgCanvas.changeSelectedAttribute(markerName, 'url(#' + id + ')'); - if (el.tagName === 'line' && pos === 'mid') { el = convertline(el); } + const newMarkerId = 'mkr_' + pos + '_' + el.id; + addMarker(newMarkerId, marker.attributes.se_type.value); + svgCanvas.changeSelectedAttribute(markerName, 'url(#' + newMarkerId + ')'); svgCanvas.call('changed', selElems); } }