From a245cf704570803923cdcf997f403181ea86539b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Montero=20Lamas?= Date: Wed, 19 Jan 2022 14:20:47 +0100 Subject: [PATCH] Hatches ordered Reworked the code to put back rows of 14 hatches. Reordered the first 14 hatches to defaault. Made 3 rows, so 42 hatches. --- index.html | 264 +++++++++++++++---------------------- modules/ui/editors.js | 8 +- modules/ui/zones-editor.js | 2 +- 3 files changed, 108 insertions(+), 166 deletions(-) diff --git a/index.html b/index.html index e65765be..7d6c6832 100644 --- a/index.html +++ b/index.html @@ -149,6 +149,8 @@ + + @@ -169,190 +171,130 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + - + - - - + + - + + + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/modules/ui/editors.js b/modules/ui/editors.js index abd2b6c2..e04adaa9 100644 --- a/modules/ui/editors.js +++ b/modules/ui/editors.js @@ -492,8 +492,8 @@ function createPicker() { .attr("id", "picker_" + d) .attr("fill", d) .attr("class", i ? "" : "selected") - .attr("x", (i % 15) * 22 + 4) - .attr("y", 40 + Math.floor(i / 15)*20) + .attr("x", (i % 14) * 22 + 4) + .attr("y", 40 + Math.floor(i / 14)*20) .attr("width", 16) .attr("height", 16); }); @@ -503,8 +503,8 @@ function createPicker() { .append("rect") .attr("id", "picker_" + this.id) .attr("fill", "url(#" + this.id + ")") - .attr("x", (i % 15) * 22 + 4) - .attr("y", Math.floor(i / 15)*20 + (number * 2)) + .attr("x", (i % 14) * 22 + 4) + .attr("y", Math.floor(i / 14)*20 + 20 + (number * 2)) .attr("width", 16) .attr("height", 16) .on("mousemove", () => tip("Click to fill with the hatching " + this.id)); diff --git a/modules/ui/zones-editor.js b/modules/ui/zones-editor.js index 79a64e53..a86428c3 100644 --- a/modules/ui/zones-editor.js +++ b/modules/ui/zones-editor.js @@ -344,7 +344,7 @@ function editZones() { function addZonesLayer() { const id = getNextId("zone"); const description = "Unknown zone"; - const fill = "url(#hatch" + (id.slice(4) % 60) + ")"; + const fill = "url(#hatch" + (id.slice(4) % 42) + ")"; zones.append("g").attr("id", id).attr("data-description", description).attr("data-cells", "").attr("fill", fill); const unit = areaUnit.value === "square" ? " " + distanceUnitInput.value + "²" : " " + areaUnit.value;