Skip to content

Commit a2f4994

Browse files
improvement(workspaces): zoom workspace glyphs to fill the 16px tile
1 parent 5570573 commit a2f4994

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎apps/sim/components/identity-tile/identity-tile.tsx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ const GLYPH_SIZE_CLASS = {
4141
/** The loader's goo: blur, then crush alpha so parts within the blur radius melt together. */
4242
const GOO_ALPHA_MATRIX = '1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9'
4343

44+
/**
45+
* Crops to the 76-unit span `generateGlyph` fits into (plus a small margin) so the
46+
* glyph fills the tile. Zooming via the viewBox, not the geometry, keeps the gaps
47+
* the goo blur is tuned to.
48+
*/
49+
const GLYPH_VIEW_BOX = '10 10 80 80'
50+
4451
function glyphShape(shape: GlyphShape, key: number) {
4552
switch (shape.kind) {
4653
case 'circle':
@@ -89,7 +96,7 @@ function Glyph({ seed, className, slot, size }: GlyphProps) {
8996
<svg
9097
data-slot={slot}
9198
aria-hidden='true'
92-
viewBox='0 0 100 100'
99+
viewBox={GLYPH_VIEW_BOX}
93100
className={cn(
94101
'shrink-0 text-[var(--text-icon)] dark:text-[var(--text-secondary)]',
95102
GLYPH_SIZE_CLASS[size],

0 commit comments

Comments
 (0)