correct value for stroke

master
Mark MacKay 2022-08-29 11:07:41 -04:00
parent 02670509f9
commit 58bbc4eb1b
1 changed files with 4 additions and 2 deletions

View File

@ -101,7 +101,8 @@ MD.Panel = function(){
const tagName = elem.tagName; const tagName = elem.tagName;
$("#" + tagName + "_panel").show(); $("#" + 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" const dash = elem.getAttribute("stroke-dasharray") || "none"
$('#stroke_style option').removeAttr('selected'); $('#stroke_style option').removeAttr('selected');
$('#stroke_style option[value="'+ dash +'"]').attr("selected", "selected"); $('#stroke_style option[value="'+ dash +'"]').attr("selected", "selected");
@ -182,7 +183,8 @@ MD.Panel = function(){
if (elem !== null) { if (elem !== null) {
$("#stroke_panel").show(); $("#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 // stroke style
const strokeStyle = elem.getAttribute("stroke-dasharray") || "none"; const strokeStyle = elem.getAttribute("stroke-dasharray") || "none";
const strokeStyles = { const strokeStyles = {