From ce6a29d8992d8ef38f8b06ad8c8eb90d8d028207 Mon Sep 17 00:00:00 2001 From: klangner Date: Mon, 14 Sep 2020 14:30:59 +0200 Subject: [PATCH] center canvas --- demo/www/index.html | 9 ++++++++- demo/www/index.js | 4 +--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/demo/www/index.html b/demo/www/index.html index 16c15cf..07d6fec 100644 --- a/demo/www/index.html +++ b/demo/www/index.html @@ -9,6 +9,13 @@ body { background-color: lightgrey; } + canvas { + padding-left: 0; + padding-right: 0; + margin-left: auto; + margin-right: auto; + display: block; + } @@ -37,7 +44,7 @@ -
+
diff --git a/demo/www/index.js b/demo/www/index.js index 95e7d32..3771b8a 100644 --- a/demo/www/index.js +++ b/demo/www/index.js @@ -23,10 +23,8 @@ const ctx = canvas.getContext('2d'); function newCellularAutomata() { var seed = Date.now(); world = World.new_cellular_automata(width, height, seed); - drawGrid(); - drawCells(); requestAnimationFrame(renderLoop); - infoDiv.textContent = "Cellular automata with the seed: " + seed; + infoDiv.textContent = "Cellular Automata with the seed: " + seed; } function newSimpleRooms() {