diff --git a/inventory/static/js/components/draw.js b/inventory/static/js/components/draw.js index 68b266f..f3682ec 100644 --- a/inventory/static/js/components/draw.js +++ b/inventory/static/js/components/draw.js @@ -37,9 +37,9 @@ function initGridWidget(root, opts = {}) { const widthValEl = root.querySelector('[data-stroke-width-val]'); if (cellSizeEl && cellSizeValEl) bindRangeWithLabel(cellSizeEl, cellSizeValEl, v => `${v}px`); - if (fillOpacityEl && fillValEl) bindRangeWithLabel(fillOpacityEl, fillValEl, v => `${Number(v) * 100}%`); - if (strokeOpacityEl && strokeValEl) bindRangeWithLabel(strokeOpacityEl, strokeValEl, v => `${Number(v) * 100}%`); - if (strokeWidthEl && widthValEl) bindRangeWithLabel(strokeWidthEl, widthValEl, v => `${Number(v) * 100}%`); + if (fillOpacityEl && fillValEl) bindRangeWithLabel(fillOpacityEl, fillValEl, v => `${parseInt(Number(v) * 100)}%`); + if (strokeOpacityEl && strokeValEl) bindRangeWithLabel(strokeOpacityEl, strokeValEl, v => `${parseInt(Number(v) * 100)}%`); + if (strokeWidthEl && widthValEl) bindRangeWithLabel(strokeWidthEl, widthValEl, v => `${parseInt(Number(v) * 100)}%`); const storageKey = opts.storageKey ?? 'gridDoc'; @@ -300,7 +300,7 @@ function initGridWidget(root, opts = {}) { gridEl.style.width = `${snappedW}px`; gridEl.style.height = `${snappedH}px`; - toolBarEl.style.maxWidth = `${snappedW}px`; + toolBarEl.style.setProperty('--grid-maxw', `${snappedW}px`); gridEl.getBoundingClientRect(); resizeAndSetupCanvas(); diff --git a/inventory/templates/components/draw.html b/inventory/templates/components/draw.html index f38ff8d..a8d0ce8 100644 --- a/inventory/templates/components/draw.html +++ b/inventory/templates/components/draw.html @@ -4,32 +4,73 @@
-
- Spacing - - 25px + -
- Fill - - 100% + -
- Stroke - - 100% + -
- Width - - 12% +
@@ -92,9 +133,15 @@ data-tool>
+