diff --git a/resources/cosmetic/cosmetic.json b/resources/cosmetic/cosmetic.json index 0aebefbbe..7f1741692 100644 --- a/resources/cosmetic/cosmetic.json +++ b/resources/cosmetic/cosmetic.json @@ -9,15 +9,15 @@ }, "pattern": { "stripes_v": { - "pattern": "ARAIBQ==", + "pattern": "ASQQVVU=", "role_group": ["all"] }, "stripes_h": { - "pattern": "ARAIAw==", + "pattern": "ASQQDw8=", "role_group": ["all"] }, "checkerboard": { - "pattern": "ARAICQ==", + "pattern": "ASQQpaU=", "role_group": ["all"] }, "diagonal": { diff --git a/src/client/Cosmetic.ts b/src/client/Cosmetic.ts index 3e8987377..9b0a33c54 100644 --- a/src/client/Cosmetic.ts +++ b/src/client/Cosmetic.ts @@ -51,7 +51,7 @@ export class PatternDecoder { height > 63 ) { throw new Error( - "Scale must be 1–128, width must be 1–127, and height must be 1–63.", + `Invalid pattern metadata: scale (log₂)=${scale}, width=${width}, height=${height}. Expected: scale 0–7, width 1–127, height 1–63.`, ); } diff --git a/src/client/TerritoryPatternsModal.ts b/src/client/TerritoryPatternsModal.ts index 5a37f005e..8255856b0 100644 --- a/src/client/TerritoryPatternsModal.ts +++ b/src/client/TerritoryPatternsModal.ts @@ -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`