diff --git a/assets/web/app.js b/assets/web/app.js
index 12c13a7..ff46a02 100644
--- a/assets/web/app.js
+++ b/assets/web/app.js
@@ -42,36 +42,31 @@ function init() {
document.body.onmouseup = onMoveableDivMouseUp;
let mapBackground = document.getElementById('map-background');
- updateGridCanvas(mapBackground.width, mapBackground.height, 1.0);
+ updateGridCanvas(mapBackground.width, mapBackground.height);
}
-function updateGridCanvas(width, height, lineWidth) {
+function updateGridCanvas(width, height) {
// Draw the grid on the grid thing
- let canvas = document.getElementById('map-grid');
- canvas.width = width;
- canvas.height = height;
- let ctx = canvas.getContext('2d');
- ctx.reset();
- if (!showGrid) { return; }
- ctx.lineWidth = lineWidth ?? 1.0;
+ let svg = document.getElementById('map-grid');
let lineDashTypes = [
[0.1, 0.8, 0.1, 0.0],
[0, 0.1, 0.1, 0.6, 0.1, 0.1],
[0, 0.1, 0.3, 0.2, 0.3, 0.1],
[0.1, 0.8, 0.1],
- ]
- ctx.setLineDash(lineDashTypes[gridDashType].map(i => GRID_SIZE * i));
- ctx.beginPath();
+ ];
+ svg.setAttribute('width', width);
+ svg.setAttribute('height', height);
+ svg.innerHTML = '';
+ svg.setAttribute('stroke', 'black');
+ svg.setAttribute('stroke-width', '15');
+ svg.setAttribute('stroke-dash-array', lineDashTypes[gridDashType].join(' '))
+
let i = 0;
while (i < Math.max(width, height)) {
i += GRID_SIZE;
- ctx.moveTo(i, 0);
- ctx.lineTo(i, width);
- ctx.moveTo(0, i);
- ctx.lineTo(height, i);
+ svg.innerHTML += `