This commit is contained in:
Aotumuri
2025-06-01 21:51:45 +09:00
parent 656a820123
commit 938e8b71a6
3 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ export class PatternDecoder {
height > 63
) {
throw new Error(
"Scale must be 1128, width must be 1127, and height must be 163.",
`Invalid pattern metadata: scale (log₂)=${scale}, width=${width}, height=${height}. Expected: scale 07, width 1127, height 163.`,
);
}
+4 -1
View File
@@ -219,7 +219,10 @@ export class TerritoryPatternsModal extends LitElement {
const cellCountX = decoder.getTileWidth();
const cellCountY = decoder.getTileHeight();
const cellSize = Math.min(height / cellCountY, width / cellCountX);
const cellSize =
cellCountX > 0 && cellCountY > 0
? Math.min(height / cellCountY, width / cellCountX)
: 1;
return html`
<div