Skip to content

Commit

Permalink
minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lorp committed May 28, 2024
1 parent e2f4e29 commit 5be5291
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/fencer.html
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,8 @@ <h2>Mappings</h2>
<option value="powers-of-10">powers of 10</option>
<option value="fill-space-40">fill space 40</option>
<option value="fill-space-20">fill space 20</option>
<option value="grid-20">grid 20</option>
<option value="grid-40">grid 40</option>
<option value="grid-20">grid 20</option>
</select>
<br>
<label for="integer-snapping">Snap to integers</label> <input type="checkbox" id="integer-snapping">
Expand Down
12 changes: 4 additions & 8 deletions src/fencer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,18 +1027,14 @@ function mappingsChanged(mode) {
let pathStr = "";

// vertical lines
for (let xn=0; xn < xGraticules.length; xn++) {
for (let yn=0; yn < yGraticules.length; yn++) {
for (let xn=0; xn < xGraticules.length; xn++)
for (let yn=0; yn < yGraticules.length; yn++)
pathStr += (yn === 0 ? "M" : "L") + svgCoordsFromAxisCoords(gridLocations[xn * yGraticules.length + yn][1]).join();
}
}

// horizontal lines
for (let yn=0; yn < yGraticules.length; yn++) {
for (let xn=0; xn < xGraticules.length; xn++) {
for (let yn=0; yn < yGraticules.length; yn++)
for (let xn=0; xn < xGraticules.length; xn++)
pathStr += (xn === 0 ? "M" : "L") + svgCoordsFromAxisCoords(gridLocations[xn * yGraticules.length + yn][1]).join();
}
}

// add the path to the SVG
const path = SVG("path", {d: pathStr, stroke: "grey", fill: "none"});
Expand Down

0 comments on commit 5be5291

Please sign in to comment.