bugfix: implementation details

This commit is contained in:
waltem01 2024-03-14 14:30:35 +01:00
parent 6fe5690a6b
commit 84fb7963d8

View File

@ -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);
});