diff --git a/Webserver/src/routes/admin/+page.svelte b/Webserver/src/routes/admin/+page.svelte index f9e3042..d613807 100644 --- a/Webserver/src/routes/admin/+page.svelte +++ b/Webserver/src/routes/admin/+page.svelte @@ -105,7 +105,7 @@ // Clear simulated matrix function clearMatrix() { - matrix.grid?.forEach((y) => y.forEach((x) => (x.color = '000000'))); + matrix?.grid?.forEach((y) => y.forEach((x) => (x.color = '000000'))); } function colorSelect(formData: FormData) { @@ -189,7 +189,7 @@ } // System variables - let scaleBind = 3; + let scaleBind = 4; let mousePressed = false; let gamepad: Gamepad | null = null; let matrix: Matrix; @@ -226,8 +226,9 @@ matrix = initializeMatrix(); matrix.scale = { - factor: 3, - padding: 0.1875 * (192 / width) * 3 + factor: 4, + // 0.1875 (made up padding) * 192 (height when it was made up) * 4 (scaling when it was made up) + padding: 144 / matrix.width }; matrix.grid = createGridArray(matrix); });