File tree Expand file tree Collapse file tree
renderer/extensions/vueNodes/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7272 @pointermove .capture =" forwardPointerMovePanEvent "
7373 >
7474 <!-- Vue nodes rendered based on graph nodes -->
75- <!--
76- Nothing is mounted while zoomed out past legibility: the canvas renderer
77- draws each node as a plain rectangle instead, which is what a node looks
78- like at that zoom anyway and costs no elements.
79- -->
80- <template v-if =" ! isLowQuality " >
75+ <template v-for =" nodeData in allNodes " :key =" nodeData .id " >
76+ <LGraphNodeLOD v-if =" isLowQuality " :node-data =" nodeData " />
8177 <LGraphNode
82- v-for =" nodeData in allNodes "
83- :key =" nodeData .id "
78+ v-else
8479 :node-data =" nodeData "
8580 :error ="
8681 executionErrorStore .lastExecutionErrorNodeId === nodeData .id
@@ -192,6 +187,7 @@ import type { StartupOutcome } from '@/platform/workflow/persistence/base/draftT
192187import { useFirstRunEntry } from ' @/renderer/extensions/firstRunTour/gettingStarted/firstRunEntry'
193188import MiniMap from ' @/renderer/extensions/minimap/MiniMap.vue'
194189import LGraphNode from ' @/renderer/extensions/vueNodes/components/LGraphNode.vue'
190+ import LGraphNodeLOD from ' @/renderer/extensions/vueNodes/components/LGraphNodeLOD.vue'
195191import { useLowQualityRendering } from ' @/renderer/extensions/vueNodes/composables/useLowQualityRendering'
196192import { requestSlotLayoutSyncForAllNodes } from ' @/renderer/extensions/vueNodes/composables/useSlotElementTracking'
197193import { UnauthorizedError } from ' @/scripts/api'
Original file line number Diff line number Diff line change @@ -5670,10 +5670,7 @@ export class LGraphCanvas implements CustomEventDispatcher<LGraphCanvasEventMap>
56705670 node . arrange ( )
56715671 }
56725672 // Skip all node body/widget/title rendering. Vue overlay handles visuals.
5673- // Except when zoomed out past the point of legibility: a node is then
5674- // just a filled rectangle, which is far cheaper to draw here than to
5675- // mount an element per node, so fall through and draw it as normal.
5676- if ( ! this . low_quality ) return
5673+ return
56775674 }
56785675
56795676 const color = node . renderingColor
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ import { computed } from ' vue'
3+
4+ import type { VueNodeData } from ' @/composables/graph/useGraphNodeManager'
5+ import { LiteGraph } from ' @/lib/litegraph/src/litegraph'
6+ import { useNodeLayout } from ' @/renderer/extensions/vueNodes/layout/useNodeLayout'
7+
8+ const { nodeData } = defineProps <{ nodeData: VueNodeData }>()
9+
10+ const { position, size } = useNodeLayout (() => nodeData .id )
11+
12+ const style = computed (() => ({
13+ transform: ` translate(${position .value .x ?? 0 }px, ${(position .value .y ?? 0 ) - LiteGraph .NODE_TITLE_HEIGHT }px) ` ,
14+ width: ` ${size .value .width ?? 0 }px ` ,
15+ height: ` ${(size .value .height ?? 0 ) + LiteGraph .NODE_TITLE_HEIGHT }px ` ,
16+ backgroundColor: nodeData .bgcolor || undefined
17+ }))
18+ </script >
19+
20+ <template >
21+ <!--
22+ Stand-in for a full node while zoomed too far out to read its text, matching
23+ litegraph's own low-quality pass, which draws a plain filled rect and skips
24+ text, badges and shadows. Deliberately childless and non-interactive: the
25+ whole point is that one node costs one element instead of a component tree.
26+ -->
27+ <div
28+ :data-node-id =" nodeData.id"
29+ data-node-lod
30+ class =" lg-node-lod pointer-events-none absolute bg-node-component-surface"
31+ :style =" style"
32+ />
33+ </template >
You can’t perform that action at this time.
0 commit comments