This commit is contained in:
Aotumuri
2025-06-01 11:00:22 +09:00
parent 618c43113b
commit 8e3d24509d
2 changed files with 16 additions and 15 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ export class PatternDecoder {
const py = norm((y / this.scale) | 0, this.tileHeight);
const idx = py * this.tileWidth + px;
const byteIndex = idx >> 3;
const bitIndex = 7 - (idx % 8);
const bitIndex = idx & 7;
const byte = this.bytes[this.dataStart + byteIndex];
if (byte === undefined) throw new Error("Invalid pattern");
return (byte & (1 << bitIndex)) !== 0;