From 58bbc4eb1b8d6233bf9111ee51a1873583135869 Mon Sep 17 00:00:00 2001 From: Mark MacKay Date: Mon, 29 Aug 2022 11:07:41 -0400 Subject: [PATCH] correct value for stroke --- src/js/Panel.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/Panel.js b/src/js/Panel.js index aa48f2b..38c247d 100644 --- a/src/js/Panel.js +++ b/src/js/Panel.js @@ -101,7 +101,8 @@ MD.Panel = function(){ const tagName = elem.tagName; $("#" + tagName + "_panel").show(); - $('#stroke_width').val(elem.getAttribute("stroke-width") || 0); + const strokeWidth = elem.getAttribute("stroke") && !elem.getAttribute("stroke-width") ? 1 : elem.getAttribute("stroke-width") || 0; + $('#stroke_width').val(strokeWidth); const dash = elem.getAttribute("stroke-dasharray") || "none" $('#stroke_style option').removeAttr('selected'); $('#stroke_style option[value="'+ dash +'"]').attr("selected", "selected"); @@ -182,7 +183,8 @@ MD.Panel = function(){ if (elem !== null) { $("#stroke_panel").show(); - $('#stroke_width').val(elem.getAttribute("stroke-width") || 0); + const strokeWidth = elem.getAttribute("stroke") && !elem.getAttribute("stroke-width") ? 1 : elem.getAttribute("stroke-width") || 0; + $('#stroke_width').val(strokeWidth); // stroke style const strokeStyle = elem.getAttribute("stroke-dasharray") || "none"; const strokeStyles = {