|
1 | 1 | import { nodeTypes } from '../nodeDefinitions'; |
2 | 2 |
|
| 3 | +const FONT_FAMILY = "'Inter', sans-serif"; |
| 4 | + |
3 | 5 | class Renderer { |
4 | 6 | constructor(camera, isDarkTheme, isGridVisible, isNodeRoundingEnabled) { |
5 | 7 | this.camera = camera; |
@@ -45,12 +47,12 @@ class Renderer { |
45 | 47 |
|
46 | 48 | getNodeDimensions(node, ctx) { |
47 | 49 | const nodeType = nodeTypes[node.type]; |
48 | | - ctx.font = 'bold 14px Arial'; |
| 50 | + ctx.font = `600 14px ${FONT_FAMILY}`; |
49 | 51 | const titleWidth = ctx.measureText(node.type).width; |
50 | 52 |
|
51 | | - ctx.font = '10px Arial'; |
| 53 | + ctx.font = `400 13px ${FONT_FAMILY}`; |
52 | 54 | const descriptionLines = this.wrapText(ctx, nodeType.description, 180); |
53 | | - const descriptionHeight = descriptionLines.length * 12; |
| 55 | + const descriptionHeight = descriptionLines.length * 14; |
54 | 56 |
|
55 | 57 | const inputsHeight = nodeType.inputs.length * 20; |
56 | 58 | const outputsHeight = nodeType.outputs.length * 20; |
@@ -258,15 +260,15 @@ class Renderer { |
258 | 260 |
|
259 | 261 | // Node title |
260 | 262 | ctx.fillStyle = 'white'; |
261 | | - ctx.font = 'bold 14px Arial'; |
| 263 | + ctx.font = `600 14px ${FONT_FAMILY}`; |
262 | 264 | currentHeight += 20; |
263 | 265 | ctx.fillText(node.type, node.x + 10, node.y + currentHeight); |
264 | 266 |
|
265 | 267 | // Node description |
266 | | - ctx.font = '10px Arial'; |
| 268 | + ctx.font = `400 13px ${FONT_FAMILY}`; |
267 | 269 | const descriptionLines = this.wrapText(ctx, nodeType.description, width - 20); |
268 | 270 | descriptionLines.forEach((line, index) => { |
269 | | - currentHeight += 12; |
| 271 | + currentHeight += 14; |
270 | 272 | ctx.fillText(line, node.x + 10, node.y + currentHeight + 3); |
271 | 273 | }); |
272 | 274 |
|
@@ -319,7 +321,7 @@ class Renderer { |
319 | 321 | // Node properties |
320 | 322 | if (nodeType.properties) { |
321 | 323 | ctx.fillStyle = 'white'; |
322 | | - ctx.font = '12px Arial'; |
| 324 | + ctx.font = `500 13px ${FONT_FAMILY}`; |
323 | 325 |
|
324 | 326 | nodeType.properties.forEach((prop, index) => { |
325 | 327 | // Check if property should be visible |
|
0 commit comments