From 6b1c3bcaa3ea7e5f7e3646af43d9c14fdbdf2c6a Mon Sep 17 00:00:00 2001 From: RemRem Date: Mon, 6 Mar 2023 17:00:22 +0100 Subject: [PATCH] resolve outline problem in createPath() --- src/Model/Const.js | 4 ++-- src/Model/card-to-html.js | 4 ++-- views/cards-test.html | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Model/Const.js b/src/Model/Const.js index f5e114a..b5fa204 100644 --- a/src/Model/Const.js +++ b/src/Model/Const.js @@ -15,8 +15,8 @@ oval : "m11.49999,95.866646c0,-44.557076 37.442923,-81.999998 82.000002,-81.9999 const OUTLINE_SPEC = { full : {}, -dot : { strokedasharray : "1 20", strokelinecap : "round" }, +dot : { "stroke-dasharray" : "1 20", "stroke-linecap" : "round" }, rect : { "stroke-dasharray" : 70}, -spade : { "stroke-dasharray" : "10 15", "stroke-width" : 70}, +spade : { "stroke-dasharray" : "10 15", "stroke-width" : 40}, sharp : {} }; diff --git a/src/Model/card-to-html.js b/src/Model/card-to-html.js index 918dfae..444b59f 100644 --- a/src/Model/card-to-html.js +++ b/src/Model/card-to-html.js @@ -41,8 +41,8 @@ class CardToHtml { // Add svg attributes for shape outline if(outline !== null){ - Object.keys(OUTLINE_SPEC.rect).forEach(function(k){ - path.setAttribute(k,OUTLINE_SPEC.rect[k]); + Object.keys(OUTLINE_SPEC[outline]).forEach(function(k){ + path.setAttribute(k,OUTLINE_SPEC[outline][k]); }); path.setAttribute('stroke','#000000'); diff --git a/views/cards-test.html b/views/cards-test.html index bd177dc..df6c828 100644 --- a/views/cards-test.html +++ b/views/cards-test.html @@ -113,11 +113,13 @@ \ No newline at end of file