diff --git a/viewer/board.js b/viewer/board.js
index f6879bc..e314edb 100644
--- a/viewer/board.js
+++ b/viewer/board.js
@@ -49,14 +49,18 @@ function tileImage(spec, c, ghost = false, prefix = "board") {
return `${ocean}${art}`;
}
function resourceBadge(x, y, items) {
- const widths = items.map(({ value }) => 34 + String(value).length * 11);
+ const widths = items.map(
+ ({ value }) =>
+ 30 +
+ [...String(value)].reduce((width, c) => width + (c === "/" ? 6 : 11), 0),
+ );
const width = widths.reduce((a, b) => a + b, 0) + 8;
let offset = x - width / 2 + 4;
return `${items
.map(({ kind, value, help }, i) => {
const left = offset;
offset += widths[i];
- return `${esc(help)}${svgIcon(kind, left, y + 3, 24)}${esc(value)}`;
+ return `${esc(help)}${svgIcon(kind, left, y + 3, 24)}${esc(value)}`;
})
.join("")}`;
}
@@ -166,10 +170,7 @@ export function boardSvg(
},
{
kind: "draw",
- value:
- preview || ghost
- ? `${tile.drawings}/${spec.drawings}`
- : tile.drawings,
+ value: `${tile.drawings}/${spec.drawings}`,
help: `${label("draw")}: ${tile.drawings}/${spec.drawings}`,
},
]);