From 7b0cee403768750b3264d358d14f20f02b2790ba Mon Sep 17 00:00:00 2001 From: Naveduran Date: Mon, 28 Oct 2024 08:26:26 -0500 Subject: [PATCH] add html for sides input --- sketch2.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sketch2.js b/sketch2.js index 06d9771..6583fc2 100644 --- a/sketch2.js +++ b/sketch2.js @@ -93,6 +93,8 @@ function drawHtmlLayer(layerConfig, layerId, totalLayers){ let fillColorInput = `` + let sidesInput = `` + let layerStructure = `
${layerId > 0 ? upButtonHtml : ''} @@ -109,14 +111,18 @@ function drawHtmlLayer(layerConfig, layerId, totalLayers){ - ${layerConfig.figureName !== 'line' ? fillColorInput : ''} + + ${layerConfig.figureName ==='polygon' ? sidesInput : ''} + ${layerConfig.figureName !== 'line' ? fillColorInput : ''}
@@ -184,9 +190,9 @@ function onChangeColor(color, input) { } // Update the history when an attribute of a layer changes -function onChangeDefault(figureId, attribute, value) { +function onChangeDefault(layerId, attribute, value) { let newConfig = structuredClone(history[currentIndex]); - newConfig.layers[figureId][attribute] = value; + newConfig.layers[layerId][attribute] = value; saveOnHistory(newConfig); }