@@ -149,6 +149,7 @@ const Node = ({
149149 const hasAnyDefinitions = definitionGraphIds . length > 0 ;
150150 // Access store state before any memoizations that depend on it
151151 const storeState = useGraphStore ( ) ;
152+ const textSettings = useGraphStore ( ( state ) => state . textSettings ) ;
152153
153154 // Determine display title: prefer current graph title in preview, else node name
154155 const currentGraphName = useMemo ( ( ) => {
@@ -182,11 +183,12 @@ const Node = ({
182183 const availableWidth = currentWidth - ( 2 * singleLineSidePadding ) ;
183184
184185 // Quick character-based estimation (more accurate than previous method)
185- const averageCharWidth = 12 ; // From constants
186+ // Account for font size scaling when calculating char width
187+ const averageCharWidth = 12 * textSettings . fontSize ; // Scale with font size
186188 const charsPerLine = Math . floor ( availableWidth / averageCharWidth ) ;
187189
188190 return displayTitle . length > charsPerLine ;
189- } , [ displayTitle , currentWidth , isPreviewing , hasAnyDefinitions ] ) ;
191+ } , [ displayTitle , currentWidth , isPreviewing , hasAnyDefinitions , textSettings . fontSize ] ) ;
190192
191193 // Get the currently displayed graph ID
192194 const currentGraphId = definitionGraphIds [ currentDefinitionIndex ] || definitionGraphIds [ 0 ] ;
@@ -393,10 +395,10 @@ const Node = ({
393395 < span
394396 className = "node-name-text"
395397 style = { {
396- fontSize : '20px' ,
398+ fontSize : ` ${ 20 * textSettings . fontSize } px` ,
397399 fontWeight : 'bold' ,
398400 color : nodeTextColor ,
399- lineHeight : '32px' , // Increased line spacing for better readability
401+ lineHeight : ` ${ 28 * textSettings . lineSpacing } px` , // Base line height changed from 32 to 28
400402 whiteSpace : 'normal' ,
401403 overflowWrap : 'break-word' ,
402404 wordBreak : 'break-word' ,
@@ -508,7 +510,8 @@ const Node = ({
508510 scaleMode = "fit"
509511 minNodeSize = { 60 }
510512 renderContext = "decomposition"
511- nodeFontScale = { 1.4 }
513+ nodeFontScale = { 1.4 * textSettings . fontSize }
514+ nodeLineHeightScale = { textSettings . lineSpacing }
512515 cornerRadiusMultiplier = { 64 }
513516 onNodeHover = { ( nodeData , isHovering ) => {
514517 if ( isHovering ) {
@@ -612,10 +615,10 @@ const Node = ({
612615 height : '100%' ,
613616 padding : '4px 8px' ,
614617 boxSizing : 'border-box' ,
615- fontSize : '20px' ,
618+ fontSize : ` ${ 20 * textSettings . fontSize } px` ,
616619 color : nodeTextColor ,
617620 fontWeight : 'normal' ,
618- lineHeight : '24px' ,
621+ lineHeight : ` ${ 24 * textSettings . lineSpacing } px` , // Tighter for description
619622 textAlign : 'center' ,
620623 wordWrap : 'break-word' ,
621624 overflowWrap : 'break-word' ,
0 commit comments