From c1f8fd77a8f9c4327a72dad4c137736a9cd36775 Mon Sep 17 00:00:00 2001 From: Adam French Date: Fri, 21 Nov 2025 23:43:10 +0000 Subject: [PATCH] copy states first --- html/js/mobile-automata.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/html/js/mobile-automata.mjs b/html/js/mobile-automata.mjs index 8e2caa5..d53235a 100644 --- a/html/js/mobile-automata.mjs +++ b/html/js/mobile-automata.mjs @@ -295,6 +295,9 @@ export function renderToCanvas(canvas, width, height, sn = 0, dn = 0) { const img = ctx.createImageData(width, height); const data = img.data; + const colorOn = [0, 0, 139]; // dark blue (active cell) + const colorOff = [0, 0, 70]; // darker blue (inactive cell) + for (let y = 0; y < height; y++) { for (let x = 0; x < width; x++) { const idx = (y * width + x) * 4; @@ -307,9 +310,6 @@ export function renderToCanvas(canvas, width, height, sn = 0, dn = 0) { } } - const colorOn = [0, 0, 139]; // dark blue (active cell) - const colorOff = [0, 0, 70]; // darker blue (inactive cell) - ctx.putImageData(img); function step() {