Add checkbox for gridlines
This commit is contained in:
@@ -44,7 +44,10 @@
|
||||
<label for="yN">N:</label><input type="number" name="yN" id="yN" placeholder="25" value="25" min="2">
|
||||
</div>
|
||||
<div>
|
||||
<label for="diamond">Tilt grid </label><input type="checkbox" name="diamond" id="diamond">
|
||||
<input type="checkbox" name="diamond" id="diamond"> <label for="diamond"> Tilt grid</label>
|
||||
</div>
|
||||
<div>
|
||||
<input type="checkbox" name="gridlines" id="gridlines" checked=true><label for="gridlines"> Show gridlines</label>
|
||||
</div>
|
||||
<!--
|
||||
Curvilinear? Inputting some random json?
|
||||
|
||||
@@ -431,7 +431,9 @@ class FieldDrawer {
|
||||
}
|
||||
let field = new Float32Array(wasm.memory.buffer, fieldPtr, width*height);
|
||||
fieldDrawer.draw(field);
|
||||
lineDrawer.draw();
|
||||
if (document.getElementById("gridlines").checked) {
|
||||
lineDrawer.draw();
|
||||
}
|
||||
}
|
||||
|
||||
async function drawLoop() {
|
||||
@@ -536,4 +538,8 @@ class FieldDrawer {
|
||||
draw();
|
||||
}
|
||||
}, {"passive": false});
|
||||
|
||||
setup();
|
||||
is_setup = true;
|
||||
animation = window.requestAnimationFrame(drawLoop);
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user