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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user