Skip to main content

jellyflow_runtime/io/config/state/views/
rendering.rs

1use crate::io::tuning::{NodeGraphPaintCachePruneTuning, NodeGraphSpatialIndexTuning};
2
3use super::super::NodeGraphInteractionState;
4
5/// Rendering and cache tuning resolved for runtime use.
6///
7/// `spatial_index` selects the optional cached spatial query backend when enabled; renderer-facing
8/// reads otherwise keep the deterministic linear path.
9#[derive(Debug, Clone, Copy, PartialEq)]
10pub struct NodeGraphRenderingInteraction {
11    pub spatial_index: NodeGraphSpatialIndexTuning,
12    pub only_render_visible_elements: bool,
13    pub paint_cache_prune: NodeGraphPaintCachePruneTuning,
14    pub elevate_nodes_on_select: bool,
15    pub elevate_edges_on_select: bool,
16}
17
18impl NodeGraphInteractionState {
19    pub fn rendering_interaction(&self) -> NodeGraphRenderingInteraction {
20        NodeGraphRenderingInteraction {
21            spatial_index: self.spatial_index,
22            only_render_visible_elements: self.only_render_visible_elements,
23            paint_cache_prune: self.paint_cache_prune,
24            elevate_nodes_on_select: self.elevate_nodes_on_select,
25            elevate_edges_on_select: self.elevate_edges_on_select,
26        }
27    }
28}