Skip to content

Commit adcd1a2

Browse files
committed
Reduce node minimum width and text padding for tighter sizing
1 parent 55a9fdc commit adcd1a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/lib/constants/dimensions.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { GRID_SIZE, G } from './grid';
99

1010
/** Node dimension constants (grid-aligned) */
1111
export const NODE = {
12-
/** Base width: 10 grid units = 100px */
13-
baseWidth: G.x10,
12+
/** Base width: 8 grid units = 80px */
13+
baseWidth: G.px(8),
1414
/** Base height: 4 grid units = 40px */
1515
baseHeight: G.x4,
1616
/** Spacing between ports: 2 grid units = 20px */
@@ -92,9 +92,9 @@ export function calculateNodeDimensions(
9292
const pinnedParamsHeight = pinnedParamCount > 0 ? 7 + 24 * pinnedParamCount : 0;
9393

9494
// Width: base, name estimate, type name estimate, pinned params minimum, port dimension (if vertical)
95-
// Name uses 10px font (~6px per char), type uses 8px font (~5px per char)
96-
const nameWidth = name.length * 6 + 24;
97-
const typeWidth = typeName ? typeName.length * 5 + 24 : 0;
95+
// Name uses 10px font (~5px per char), type uses 8px font (~4px per char), plus padding for node margins
96+
const nameWidth = name.length * 5 + 20;
97+
const typeWidth = typeName ? typeName.length * 4 + 20 : 0;
9898
const pinnedParamsWidth = pinnedParamCount > 0 ? 160 : 0;
9999
const width = snapTo2G(Math.max(
100100
NODE.baseWidth,

0 commit comments

Comments
 (0)