Web Dev Solutions

Catalin Mititiuc

aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCatalin Mititiuc <webdevcat@proton.me>2024-07-03 11:36:24 -0700
committerCatalin Mititiuc <webdevcat@proton.me>2024-07-03 11:36:24 -0700
commit16b987f46f446398eececf72aa01c551305948d3 (patch)
tree83647a695e1a93ae489bb5f136c3afcf2ad0cd82 /src
parentd244c16e101901c6b5987f16a0b743163afc584b (diff)
Minor cleanup
Diffstat (limited to 'src')
-rw-r--r--src/radial.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/radial.js b/src/radial.js
index ca79c35..7288640 100644
--- a/src/radial.js
+++ b/src/radial.js
@@ -16,7 +16,7 @@ function toKey({ q, r, s, t = 0 } = {}) {
function fromKey(key) {
const split = key.split(',');
- return { q: +split[0], r: +split[1], s: +split[2], t: +(split[3] || 1) };
+ return { q: +split[0], r: +split[1], s: +split[2], t: +(split[3] || 0) };
}
function sameSigns(a, b) {
@@ -93,7 +93,7 @@ function drawHexes(el, list, renderText = false) {
use.setAttributeNS(null, 'href', '#hex');
cell.appendChild(use);
- if (false) addHexText(q, r, s, t).forEach(txt => cell.appendChild(txt));
+ if (renderText) addHexText(q, r, s, t).forEach(txt => cell.appendChild(txt));
list.set(key, cell);
el.appendChild(cell);
@@ -437,7 +437,7 @@ function drawBuildings(buildings, container, { q: pq, r: pr, s: ps }, features)
buildingContainer.appendChild(hexContainer);
buildingGrid = translateCoords(buildingGrid, ({ q, r, s }) => ({ q, r, s, t: elevationLevel }));
- drawHexes(hexContainer, buildingGrid, true);
+ drawHexes(hexContainer, buildingGrid);
acc = new Map([...acc, ...buildingGrid]);
});
@@ -503,7 +503,7 @@ function drawMapsheet(gameboard, mapsheet, position) {
);
for ([coords, v] of buildingHexes) grid.delete(coords);
- drawHexes(gridContainer, grid, true);
+ drawHexes(gridContainer, grid);
(mapsheet.features || []).forEach(feature => {
const featureContainer = document.createElementNS(xmlns, 'g');