mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Clean up some document-legacy code
This commit is contained in:
@@ -18,7 +18,7 @@ use crate::node_graph_executor::NodeGraphExecutor;
|
||||
|
||||
use document_legacy::document::Document as DocumentLegacy;
|
||||
use document_legacy::document_metadata::LayerNodeIdentifier;
|
||||
use document_legacy::layers::layer_info::{LayerDataType, LayerDataTypeDiscriminant};
|
||||
use document_legacy::layers::layer_info::{LayerDataTypeDiscriminant, LegacyLayerType};
|
||||
use document_legacy::layers::style::{RenderData, ViewMode};
|
||||
use document_legacy::{DocumentError, DocumentResponse, LayerId, Operation as DocumentOperation};
|
||||
use graph_craft::document::value::TaggedValue;
|
||||
@@ -44,7 +44,8 @@ pub struct DocumentMessageHandler {
|
||||
pub version: String,
|
||||
#[serde(default)]
|
||||
pub commit_hash: String,
|
||||
|
||||
#[serde(default)]
|
||||
pub collapsed_folders: Vec<LayerNodeIdentifier>,
|
||||
pub document_mode: DocumentMode,
|
||||
pub view_mode: ViewMode,
|
||||
#[serde(skip)]
|
||||
@@ -52,7 +53,6 @@ pub struct DocumentMessageHandler {
|
||||
pub overlays_visible: bool,
|
||||
#[serde(default = "return_true")]
|
||||
pub rulers_visible: bool,
|
||||
|
||||
#[serde(skip)]
|
||||
pub document_undo_history: VecDeque<DocumentSave>,
|
||||
#[serde(skip)]
|
||||
@@ -60,12 +60,10 @@ pub struct DocumentMessageHandler {
|
||||
/// Don't allow aborting transactions whilst undoing to avoid #559
|
||||
#[serde(skip)]
|
||||
undo_in_progress: bool,
|
||||
|
||||
#[serde(with = "vectorize_layer_metadata")]
|
||||
pub layer_metadata: HashMap<Vec<LayerId>, LayerMetadata>,
|
||||
#[serde(skip)]
|
||||
layer_range_selection_reference: Option<LayerNodeIdentifier>,
|
||||
|
||||
navigation_handler: NavigationMessageHandler,
|
||||
#[serde(skip)]
|
||||
overlays_message_handler: OverlaysMessageHandler,
|
||||
@@ -84,20 +82,17 @@ impl Default for DocumentMessageHandler {
|
||||
name: DEFAULT_DOCUMENT_NAME.to_string(),
|
||||
version: GRAPHITE_DOCUMENT_VERSION.to_string(),
|
||||
commit_hash: crate::application::GRAPHITE_GIT_COMMIT_HASH.to_string(),
|
||||
|
||||
collapsed_folders: Vec::new(),
|
||||
document_mode: DocumentMode::DesignMode,
|
||||
view_mode: ViewMode::default(),
|
||||
snapping_state: SnappingState::default(),
|
||||
overlays_visible: true,
|
||||
rulers_visible: true,
|
||||
|
||||
document_undo_history: VecDeque::new(),
|
||||
document_redo_history: VecDeque::new(),
|
||||
undo_in_progress: false,
|
||||
|
||||
layer_metadata: vec![(vec![], LayerMetadata::new(true))].into_iter().collect(),
|
||||
layer_range_selection_reference: None,
|
||||
|
||||
navigation_handler: NavigationMessageHandler::default(),
|
||||
overlays_message_handler: OverlaysMessageHandler::default(),
|
||||
properties_panel_message_handler: PropertiesPanelMessageHandler::default(),
|
||||
@@ -199,13 +194,14 @@ impl MessageHandler<DocumentMessage, DocumentInputs<'_>> for DocumentMessageHand
|
||||
document: &mut self.document_legacy,
|
||||
document_id,
|
||||
document_name: self.name.as_str(),
|
||||
collapsed_folders: &mut self.collapsed_folders,
|
||||
input: ipp,
|
||||
graph_view_overlay_open,
|
||||
},
|
||||
);
|
||||
}
|
||||
#[remain::unsorted]
|
||||
GraphOperation(message) => GraphOperationMessageHandler.process_message(message, responses, (&mut self.document_legacy, &mut self.node_graph_handler)),
|
||||
GraphOperation(message) => GraphOperationMessageHandler.process_message(message, responses, (&mut self.document_legacy, &mut self.collapsed_folders, &mut self.node_graph_handler)),
|
||||
|
||||
// Messages
|
||||
AbortTransaction => {
|
||||
@@ -388,7 +384,7 @@ impl MessageHandler<DocumentMessage, DocumentInputs<'_>> for DocumentMessageHand
|
||||
|
||||
let layer = self.document_legacy.layer(layer_path).expect("Clearing Layer image for invalid layer");
|
||||
let previous_blob_url = match &layer.data {
|
||||
LayerDataType::Layer(layer) => layer.as_blob_url(),
|
||||
LegacyLayerType::Layer(layer) => layer.as_blob_url(),
|
||||
x => panic!("Cannot find blob url for layer type {}", LayerDataTypeDiscriminant::from(x)),
|
||||
};
|
||||
|
||||
@@ -715,7 +711,7 @@ impl MessageHandler<DocumentMessage, DocumentInputs<'_>> for DocumentMessageHand
|
||||
|
||||
// Revoke the old blob URL
|
||||
match &layer.data {
|
||||
LayerDataType::Layer(layer) => {
|
||||
LegacyLayerType::Layer(layer) => {
|
||||
if let Some(url) = layer.as_blob_url() {
|
||||
responses.add(FrontendMessage::TriggerRevokeBlobUrl { url: url.clone() });
|
||||
}
|
||||
@@ -785,10 +781,10 @@ impl MessageHandler<DocumentMessage, DocumentInputs<'_>> for DocumentMessageHand
|
||||
StartTransaction => self.backup(responses),
|
||||
ToggleLayerExpansion { layer } => {
|
||||
let layer = LayerNodeIdentifier::new(layer, self.network());
|
||||
if self.document_legacy.collapsed_folders.contains(&layer) {
|
||||
self.document_legacy.collapsed_folders.retain(|&collapsed_layer| collapsed_layer != layer);
|
||||
if self.collapsed_folders.contains(&layer) {
|
||||
self.collapsed_folders.retain(|&collapsed_layer| collapsed_layer != layer);
|
||||
} else {
|
||||
self.document_legacy.collapsed_folders.push(layer);
|
||||
self.collapsed_folders.push(layer);
|
||||
}
|
||||
responses.add(NodeGraphMessage::RunDocumentGraph);
|
||||
}
|
||||
@@ -900,6 +896,7 @@ impl DocumentMessageHandler {
|
||||
pub fn network(&self) -> &NodeNetwork {
|
||||
&self.document_legacy.document_network
|
||||
}
|
||||
|
||||
pub fn metadata(&self) -> &document_legacy::document_metadata::DocumentMetadata {
|
||||
&self.document_legacy.metadata
|
||||
}
|
||||
@@ -1013,7 +1010,7 @@ impl DocumentMessageHandler {
|
||||
for layer_node in folder.children(self.metadata()) {
|
||||
data.push(layer_node.to_node());
|
||||
space += 1;
|
||||
if layer_node.has_children(self.metadata()) && !self.document_legacy.collapsed_folders.contains(&layer_node) {
|
||||
if layer_node.has_children(self.metadata()) && !self.collapsed_folders.contains(&layer_node) {
|
||||
path.push(layer_node.to_node());
|
||||
|
||||
// TODO: Skip if folder is not expanded.
|
||||
|
||||
@@ -571,8 +571,13 @@ impl<'a> ModifyInputsContext<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl MessageHandler<GraphOperationMessage, (&mut Document, &mut NodeGraphMessageHandler)> for GraphOperationMessageHandler {
|
||||
fn process_message(&mut self, message: GraphOperationMessage, responses: &mut VecDeque<Message>, (document, node_graph): (&mut Document, &mut NodeGraphMessageHandler)) {
|
||||
impl MessageHandler<GraphOperationMessage, (&mut Document, &mut Vec<LayerNodeIdentifier>, &mut NodeGraphMessageHandler)> for GraphOperationMessageHandler {
|
||||
fn process_message(
|
||||
&mut self,
|
||||
message: GraphOperationMessage,
|
||||
responses: &mut VecDeque<Message>,
|
||||
(document, collapsed_folders, node_graph): (&mut Document, &mut Vec<LayerNodeIdentifier>, &mut NodeGraphMessageHandler),
|
||||
) {
|
||||
match message {
|
||||
GraphOperationMessage::FillSet { layer, fill } => {
|
||||
if let Some(mut modify_inputs) = ModifyInputsContext::new_with_layer(&layer, document, node_graph, responses) {
|
||||
@@ -652,7 +657,7 @@ impl MessageHandler<GraphOperationMessage, (&mut Document, &mut NodeGraphMessage
|
||||
if let Some(layer) = modify_inputs.create_layer(id, modify_inputs.network.original_outputs()[0].node_id, 0, 0) {
|
||||
modify_inputs.insert_artboard(artboard, layer);
|
||||
}
|
||||
document.load_network_structure();
|
||||
load_network_structure(document, collapsed_folders);
|
||||
}
|
||||
GraphOperationMessage::NewBitmapLayer {
|
||||
id,
|
||||
@@ -705,14 +710,14 @@ impl MessageHandler<GraphOperationMessage, (&mut Document, &mut NodeGraphMessage
|
||||
modify_inputs.responses.add(NodeGraphMessage::SendGraph { should_rerender: true });
|
||||
}
|
||||
|
||||
document.load_network_structure();
|
||||
load_network_structure(document, collapsed_folders);
|
||||
}
|
||||
GraphOperationMessage::NewVectorLayer { id, subpaths, parent, insert_index } => {
|
||||
let mut modify_inputs = ModifyInputsContext::new(document, node_graph, responses);
|
||||
if let Some(layer) = modify_inputs.create_layer_with_insert_index(id, insert_index, parent) {
|
||||
modify_inputs.insert_vector_data(subpaths, layer);
|
||||
}
|
||||
document.load_network_structure();
|
||||
load_network_structure(document, collapsed_folders);
|
||||
}
|
||||
GraphOperationMessage::NewTextLayer {
|
||||
id,
|
||||
@@ -726,7 +731,7 @@ impl MessageHandler<GraphOperationMessage, (&mut Document, &mut NodeGraphMessage
|
||||
if let Some(layer) = modify_inputs.create_layer_with_insert_index(id, insert_index, parent) {
|
||||
modify_inputs.insert_text(text, font, size, layer);
|
||||
}
|
||||
document.load_network_structure();
|
||||
load_network_structure(document, collapsed_folders);
|
||||
}
|
||||
GraphOperationMessage::ResizeArtboard { id, location, dimensions } => {
|
||||
if let Some(mut modify_inputs) = ModifyInputsContext::new_with_layer(&[id], document, node_graph, responses) {
|
||||
@@ -736,7 +741,7 @@ impl MessageHandler<GraphOperationMessage, (&mut Document, &mut NodeGraphMessage
|
||||
GraphOperationMessage::DeleteLayer { id } => {
|
||||
let mut modify_inputs = ModifyInputsContext::new(document, node_graph, responses);
|
||||
modify_inputs.delete_layer(id);
|
||||
document.load_network_structure();
|
||||
load_network_structure(document, collapsed_folders);
|
||||
}
|
||||
GraphOperationMessage::ClearArtboards => {
|
||||
let mut modify_inputs = ModifyInputsContext::new(document, node_graph, responses);
|
||||
@@ -746,7 +751,7 @@ impl MessageHandler<GraphOperationMessage, (&mut Document, &mut NodeGraphMessage
|
||||
modify_inputs.delete_layer(layer);
|
||||
}
|
||||
}
|
||||
document.load_network_structure();
|
||||
load_network_structure(document, collapsed_folders);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -755,3 +760,8 @@ impl MessageHandler<GraphOperationMessage, (&mut Document, &mut NodeGraphMessage
|
||||
actions!(GraphOperationMessage; )
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load_network_structure(document: &mut Document, collapsed_folders: &mut Vec<LayerNodeIdentifier>) {
|
||||
document.metadata.load_structure(&document.document_network);
|
||||
collapsed_folders.retain(|&layer| document.metadata.layer_exists(layer));
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
pub use self::document_node_types::*;
|
||||
use super::load_network_structure;
|
||||
use crate::messages::input_mapper::utility_types::macros::action_keys;
|
||||
use crate::messages::layout::utility_types::widget_prelude::*;
|
||||
use crate::messages::prelude::*;
|
||||
use crate::node_graph_executor::GraphIdentifier;
|
||||
|
||||
use document_legacy::document::Document;
|
||||
use document_legacy::document_metadata::LayerNodeIdentifier;
|
||||
use document_legacy::LayerId;
|
||||
use graph_craft::document::value::TaggedValue;
|
||||
use graph_craft::document::{DocumentNode, NodeId, NodeInput, NodeNetwork, NodeOutput};
|
||||
@@ -453,15 +455,20 @@ pub struct NodeGraphHandlerData<'a> {
|
||||
pub document: &'a mut Document,
|
||||
pub document_id: u64,
|
||||
pub document_name: &'a str,
|
||||
pub collapsed_folders: &'a mut Vec<LayerNodeIdentifier>,
|
||||
pub input: &'a InputPreprocessorMessageHandler,
|
||||
pub graph_view_overlay_open: bool,
|
||||
}
|
||||
|
||||
impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGraphMessageHandler {
|
||||
fn process_message(&mut self, message: NodeGraphMessage, responses: &mut VecDeque<Message>, data: NodeGraphHandlerData<'a>) {
|
||||
let document = data.document;
|
||||
let document_id = data.document_id;
|
||||
let graph_view_overlay_open = data.graph_view_overlay_open;
|
||||
let NodeGraphHandlerData {
|
||||
document,
|
||||
document_id,
|
||||
collapsed_folders,
|
||||
graph_view_overlay_open,
|
||||
..
|
||||
} = data;
|
||||
match message {
|
||||
// TODO: automatically remove broadcast messages.
|
||||
NodeGraphMessage::Init => {
|
||||
@@ -469,7 +476,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGrap
|
||||
on: BroadcastEvent::SelectionChanged,
|
||||
send: Box::new(NodeGraphMessage::SelectedNodesUpdated.into()),
|
||||
});
|
||||
document.load_network_structure();
|
||||
load_network_structure(document, collapsed_folders);
|
||||
responses.add(DocumentMessage::DocumentStructureChanged);
|
||||
}
|
||||
NodeGraphMessage::SelectedNodesUpdated => {
|
||||
@@ -811,7 +818,7 @@ impl<'a> MessageHandler<NodeGraphMessage, NodeGraphHandlerData<'a>> for NodeGrap
|
||||
let structure_changed = node_input.as_node().is_some() || input.as_node().is_some();
|
||||
*node_input = input;
|
||||
if structure_changed {
|
||||
document.load_network_structure();
|
||||
load_network_structure(document, collapsed_folders);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::messages::prelude::*;
|
||||
use crate::node_graph_executor::NodeGraphExecutor;
|
||||
|
||||
use document_legacy::document::Document;
|
||||
use document_legacy::layers::layer_info::{Layer, LayerDataType};
|
||||
use document_legacy::layers::layer_info::{LegacyLayer, LegacyLayerType};
|
||||
use document_legacy::layers::style::{Fill, Gradient, GradientType, LineCap, LineJoin, RenderData, Stroke, ViewMode};
|
||||
use graphene_core::raster::color::Color;
|
||||
|
||||
@@ -15,7 +15,7 @@ use glam::{DAffine2, DVec2};
|
||||
use std::f64::consts::PI;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub fn apply_transform_operation(layer: &Layer, transform_op: TransformOp, value: f64, render_data: &RenderData) -> [f64; 6] {
|
||||
pub fn apply_transform_operation(layer: &LegacyLayer, transform_op: TransformOp, value: f64, render_data: &RenderData) -> [f64; 6] {
|
||||
let transformation = match transform_op {
|
||||
TransformOp::X => DAffine2::update_x,
|
||||
TransformOp::Y => DAffine2::update_y,
|
||||
@@ -67,7 +67,7 @@ pub fn apply_transform_operation(layer: &Layer, transform_op: TransformOp, value
|
||||
pub fn register_artwork_layer_properties(
|
||||
document: &Document,
|
||||
layer_path: Vec<document_legacy::LayerId>,
|
||||
layer: &Layer,
|
||||
layer: &LegacyLayer,
|
||||
responses: &mut VecDeque<Message>,
|
||||
persistent_data: &PersistentData,
|
||||
node_graph_message_handler: &NodeGraphMessageHandler,
|
||||
@@ -76,9 +76,9 @@ pub fn register_artwork_layer_properties(
|
||||
let options_bar = vec![LayoutGroup::Row {
|
||||
widgets: vec![
|
||||
match &layer.data {
|
||||
LayerDataType::Folder(_) => IconLabel::new("Folder").tooltip("Folder").widget_holder(),
|
||||
LayerDataType::Shape(_) => IconLabel::new("NodeShape").tooltip("Shape").widget_holder(),
|
||||
LayerDataType::Layer(_) => IconLabel::new("Layer").tooltip("Layer").widget_holder(),
|
||||
LegacyLayerType::Folder(_) => IconLabel::new("Folder").tooltip("Folder").widget_holder(),
|
||||
LegacyLayerType::Shape(_) => IconLabel::new("NodeShape").tooltip("Shape").widget_holder(),
|
||||
LegacyLayerType::Layer(_) => IconLabel::new("Layer").tooltip("Layer").widget_holder(),
|
||||
},
|
||||
Separator::new(SeparatorType::Unrelated).widget_holder(),
|
||||
TextInput::new(layer.name.clone().unwrap_or_else(|| "Untitled Layer".to_string()))
|
||||
@@ -90,7 +90,7 @@ pub fn register_artwork_layer_properties(
|
||||
}];
|
||||
|
||||
let properties_body = match &layer.data {
|
||||
LayerDataType::Shape(shape) => {
|
||||
LegacyLayerType::Shape(shape) => {
|
||||
if let Some(fill_layout) = node_section_fill(shape.style.fill()) {
|
||||
vec![
|
||||
node_section_transform(layer, persistent_data),
|
||||
@@ -101,7 +101,7 @@ pub fn register_artwork_layer_properties(
|
||||
vec![node_section_transform(layer, persistent_data), node_section_stroke(&shape.style.stroke().unwrap_or_default())]
|
||||
}
|
||||
}
|
||||
LayerDataType::Layer(layer) => {
|
||||
LegacyLayerType::Layer(layer) => {
|
||||
let mut context = NodePropertiesContext {
|
||||
persistent_data,
|
||||
document,
|
||||
@@ -115,7 +115,7 @@ pub fn register_artwork_layer_properties(
|
||||
|
||||
properties_sections
|
||||
}
|
||||
LayerDataType::Folder(_) => {
|
||||
LegacyLayerType::Folder(_) => {
|
||||
vec![node_section_transform(layer, persistent_data)]
|
||||
}
|
||||
};
|
||||
@@ -155,7 +155,7 @@ pub fn register_document_graph_properties(mut context: NodePropertiesContext, no
|
||||
});
|
||||
}
|
||||
|
||||
fn node_section_transform(layer: &Layer, persistent_data: &PersistentData) -> LayoutGroup {
|
||||
fn node_section_transform(layer: &LegacyLayer, persistent_data: &PersistentData) -> LayoutGroup {
|
||||
let render_data = RenderData::new(&persistent_data.font_cache, ViewMode::default(), None);
|
||||
let pivot = layer.transform.transform_vector2(layer.layerspace_pivot(&render_data));
|
||||
LayoutGroup::Section {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use document_legacy::layers::layer_info::{Layer, LayerData, LayerDataTypeDiscriminant};
|
||||
use document_legacy::layers::layer_info::{LayerData, LayerDataTypeDiscriminant, LegacyLayer};
|
||||
use document_legacy::layers::style::RenderData;
|
||||
use document_legacy::LayerId;
|
||||
|
||||
@@ -60,7 +60,7 @@ pub struct LayerPanelEntry {
|
||||
impl LayerPanelEntry {
|
||||
// TODO: Deprecate this because it's using document-legacy layer data which is no longer linked to data from the node graph,
|
||||
// TODO: so this doesn't feed `name` (that's fed elsewhere) or `visible` (that's broken entirely), etc.
|
||||
pub fn new(layer_metadata: &LayerMetadata, transform: DAffine2, layer: &Layer, path: Vec<LayerId>, render_data: &RenderData) -> Self {
|
||||
pub fn new(layer_metadata: &LayerMetadata, transform: DAffine2, layer: &LegacyLayer, path: Vec<LayerId>, render_data: &RenderData) -> Self {
|
||||
let name = layer.name.clone().unwrap_or_else(|| String::from(""));
|
||||
|
||||
let mut tooltip = name.clone();
|
||||
|
||||
@@ -719,8 +719,10 @@ impl PortfolioMessageHandler {
|
||||
return;
|
||||
};
|
||||
|
||||
self.executor.poll_node_graph_evaluation(&mut active_document.document_legacy, responses).unwrap_or_else(|e| {
|
||||
log::error!("Error while evaluating node graph: {e}");
|
||||
});
|
||||
self.executor
|
||||
.poll_node_graph_evaluation(&mut active_document.document_legacy, &mut active_document.collapsed_folders, responses)
|
||||
.unwrap_or_else(|e| {
|
||||
log::error!("Error while evaluating node graph: {e}");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ use crate::consts::{
|
||||
use crate::messages::prelude::*;
|
||||
|
||||
use document_legacy::document_metadata::LayerNodeIdentifier;
|
||||
use document_legacy::layers::layer_info::Layer;
|
||||
use document_legacy::layers::layer_info::LegacyLayer;
|
||||
use document_legacy::layers::style::{self, Stroke};
|
||||
use document_legacy::{LayerId, Operation};
|
||||
use graphene_core::vector::{ManipulatorPointId, SelectedType};
|
||||
@@ -262,7 +262,7 @@ impl SnapManager {
|
||||
&mut self,
|
||||
document_message_handler: &DocumentMessageHandler,
|
||||
input: &InputPreprocessorMessageHandler,
|
||||
layer: &Layer,
|
||||
layer: &LegacyLayer,
|
||||
path: &[LayerId],
|
||||
include_handles: bool,
|
||||
ignore_points: &[ManipulatorPointInfo],
|
||||
|
||||
@@ -6,7 +6,7 @@ use crate::messages::portfolio::document::utility_types::misc::{LayerMetadata, L
|
||||
use crate::messages::prelude::*;
|
||||
use document_legacy::document::Document as DocumentLegacy;
|
||||
use document_legacy::document_metadata::LayerNodeIdentifier;
|
||||
use document_legacy::layers::layer_info::{LayerDataType, LayerDataTypeDiscriminant};
|
||||
use document_legacy::layers::layer_info::{LayerDataTypeDiscriminant, LegacyLayerType};
|
||||
use document_legacy::{LayerId, Operation};
|
||||
use graph_craft::document::value::TaggedValue;
|
||||
use graph_craft::document::{generate_uuid, DocumentNodeImplementation, NodeId, NodeNetwork};
|
||||
@@ -499,7 +499,7 @@ impl NodeGraphExecutor {
|
||||
let layer = document.document_legacy.layer(&layer_path).map_err(|e| format!("No layer: {e:?}"))?;
|
||||
|
||||
let layer_layer = match &layer.data {
|
||||
LayerDataType::Layer(layer) => Ok(layer),
|
||||
LegacyLayerType::Layer(layer) => Ok(layer),
|
||||
_ => Err("Invalid layer type".to_string()),
|
||||
}?;
|
||||
layer_layer.network.clone()
|
||||
@@ -595,7 +595,7 @@ impl NodeGraphExecutor {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn poll_node_graph_evaluation(&mut self, document: &mut DocumentLegacy, responses: &mut VecDeque<Message>) -> Result<(), String> {
|
||||
pub fn poll_node_graph_evaluation(&mut self, document: &mut DocumentLegacy, collapsed_folders: &mut Vec<LayerNodeIdentifier>, responses: &mut VecDeque<Message>) -> Result<(), String> {
|
||||
let results = self.receiver.try_iter().collect::<Vec<_>>();
|
||||
for response in results {
|
||||
match response {
|
||||
@@ -634,7 +634,7 @@ impl NodeGraphExecutor {
|
||||
LayerDataTypeDiscriminant::Layer
|
||||
},
|
||||
layer_metadata: LayerMetadata {
|
||||
expanded: layer.has_children(&document.metadata) && !document.collapsed_folders.contains(&layer),
|
||||
expanded: layer.has_children(&document.metadata) && !collapsed_folders.contains(&layer),
|
||||
selected: document.metadata.selected_layers_contains(layer),
|
||||
},
|
||||
path: vec![node_id],
|
||||
|
||||
Reference in New Issue
Block a user