@@ -55,9 +55,9 @@ class Renderer {
5555 const inputsHeight = nodeType . inputs . length * 20 ;
5656 const outputsHeight = nodeType . outputs . length * 20 ;
5757 const propertiesHeight = nodeType . properties ? nodeType . properties . reduce ( ( height , prop ) => {
58- const isVisible = prop . visible === undefined ||
59- ( typeof prop . visible === 'function' ?
60- prop . visible ( node . properties ) :
58+ const isVisible = prop . visible === undefined ||
59+ ( typeof prop . visible === 'function' ?
60+ prop . visible ( node . properties ) :
6161 prop . visible ) ;
6262 return height + ( isVisible ? 20 : 0 ) ;
6363 } , 0 ) : 0 ;
@@ -117,17 +117,17 @@ class Renderer {
117117 edges . forEach ( edge => {
118118 const startNode = nodes . find ( n => n . id === edge . start . nodeId ) ;
119119 const endNode = nodes . find ( n => n . id === edge . end . nodeId ) ;
120-
120+
121121 if ( ! startNode || ! endNode ) return ;
122122
123123 // Quick bounds check for edge endpoints
124124 const startDims = this . getNodeDimensions ( startNode , ctx ) ;
125125 const endDims = this . getNodeDimensions ( endNode , ctx ) ;
126-
126+
127127 // Skip if both nodes are completely outside view (with padding)
128128 const padding = 200 ; // Larger padding for edges due to curves
129129 if ( ! this . isRectInView ( startNode . x , startNode . y , startDims . width , startDims . height , ctx . canvas . width , ctx . canvas . height , padding ) &&
130- ! this . isRectInView ( endNode . x , endNode . y , endDims . width , endDims . height , ctx . canvas . width , ctx . canvas . height , padding ) ) {
130+ ! this . isRectInView ( endNode . x , endNode . y , endDims . width , endDims . height , ctx . canvas . width , ctx . canvas . height , padding ) ) {
131131 return ;
132132 }
133133
@@ -173,7 +173,7 @@ class Renderer {
173173 drawPortIcon ( ctx , x , y , isInput ) {
174174 const offset = 5 ; // Distance from node border
175175 const arrowX = isInput ? x - offset : x + offset ;
176-
176+
177177 ctx . beginPath ( ) ;
178178 if ( isInput ) {
179179 ctx . moveTo ( arrowX - 6 , y - 5 ) ;
@@ -193,7 +193,7 @@ class Renderer {
193193 drawLabelArrow ( ctx , x , y , isControl ) {
194194 if ( isControl ) {
195195 const lineLength = 10 ;
196-
196+
197197 // Draw line
198198 ctx . beginPath ( ) ;
199199 ctx . moveTo ( x , y ) ;
@@ -222,7 +222,7 @@ class Renderer {
222222 drawNodes ( ctx , nodes , edges , selectedNodes ) {
223223 nodes . forEach ( node => {
224224 const { width, height } = this . getNodeDimensions ( node , ctx ) ;
225-
225+
226226 if ( ! this . isRectInView ( node . x , node . y , width , height , ctx . canvas . width , ctx . canvas . height ) ) {
227227 return ;
228228 }
@@ -276,18 +276,18 @@ class Renderer {
276276 nodeType . inputs . forEach ( ( input , i ) => {
277277 const portY = node . y + currentHeight + i * 20 ;
278278 const isControl = input . type === 'control' ;
279-
279+
280280 // Check if port is connected
281- const isPortConnected = edges . some ( edge =>
282- edge . end . nodeId === node . id &&
283- edge . end . index === i &&
281+ const isPortConnected = edges . some ( edge =>
282+ edge . end . nodeId === node . id &&
283+ edge . end . index === i &&
284284 edge . end . isInput
285285 ) ;
286-
286+
287287 if ( ! isPortConnected ) {
288288 this . drawPortIcon ( ctx , node . x , portY , true ) ;
289289 }
290-
290+
291291 this . drawLabelArrow ( ctx , node . x + 15 , portY , isControl ) ;
292292 ctx . fillStyle = 'white' ;
293293 ctx . fillText ( input . name , node . x + 35 , portY + 5 ) ;
@@ -297,17 +297,17 @@ class Renderer {
297297 nodeType . outputs . forEach ( ( output , i ) => {
298298 const portY = node . y + currentHeight + i * 20 ;
299299 const isControl = output . type === 'control' ;
300-
301- const isPortConnected = edges . some ( edge =>
302- edge . start . nodeId === node . id &&
303- edge . start . index === i &&
300+
301+ const isPortConnected = edges . some ( edge =>
302+ edge . start . nodeId === node . id &&
303+ edge . start . index === i &&
304304 ! edge . start . isInput
305305 ) ;
306-
306+
307307 if ( ! isPortConnected ) {
308308 this . drawPortIcon ( ctx , node . x + width , portY , false ) ;
309309 }
310-
310+
311311 ctx . fillStyle = 'white' ;
312312 const textWidth = ctx . measureText ( output . name ) . width ;
313313 ctx . fillText ( output . name , node . x + width - textWidth - 35 , portY + 5 ) ;
@@ -323,9 +323,9 @@ class Renderer {
323323
324324 nodeType . properties . forEach ( ( prop , index ) => {
325325 // Check if property should be visible
326- const isVisible = prop . visible === undefined ||
327- ( typeof prop . visible === 'function' ?
328- prop . visible ( node . properties ) :
326+ const isVisible = prop . visible === undefined ||
327+ ( typeof prop . visible === 'function' ?
328+ prop . visible ( node . properties ) :
329329 prop . visible ) ;
330330
331331 if ( isVisible ) {
@@ -384,9 +384,9 @@ class Renderer {
384384 } ;
385385
386386 return ! ( x + width < viewBounds . left - padding ||
387- x > viewBounds . right + padding ||
388- y + height < viewBounds . top - padding ||
389- y > viewBounds . bottom + padding ) ;
387+ x > viewBounds . right + padding ||
388+ y + height < viewBounds . top - padding ||
389+ y > viewBounds . bottom + padding ) ;
390390 }
391391}
392392
0 commit comments