feat(web): inset token silhouette by 2px

Pass a negative offset through traceImage so the traced token shape
sits slightly inside the artwork, hiding the anti-aliased fringe.
This commit is contained in:
2026-08-08 15:37:32 +08:00
parent 9094ad58e0
commit a2f7c998fc
2 changed files with 9 additions and 2 deletions
@@ -14,6 +14,9 @@ import { assetUrl } from './assetUrl';
const TOKEN_SIZE = 1.8;
/** How far (in trace pixels) the token silhouette is inset from the artwork. */
const TRACE_INSET = 2;
/**
* A token: a short extruded shape with the texture on its top face. Uses
* `CustomImage.ImageURL` (falling back to `ImageSecondaryURL`), with a neutral
@@ -46,7 +49,7 @@ function TokenMesh({ url, thickness }: { url?: string; thickness: number }) {
let cancelled = false;
setTrace(null);
if (!url) return;
traceImage(url, 'alpha')
traceImage(url, 'alpha', -TRACE_INSET)
.then((result) => {
if (!cancelled && result.shape) {
setTrace({