mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-26 03:28:12 +08:00
Instance tables refactor part 8: Make repeater nodes use pivot not bbox and output instance type not group; rename 'Flatten Vector Elements' to 'Flatten Path' and add 'Flatten Vector' (#2697)
Make repeater nodes use pivot not bbox and output instance type not group; rename 'Flatten Vector Elements' to 'Flatten Path' and add 'Flatten Vector'
This commit is contained in:
@@ -91,9 +91,9 @@ pub fn merge_layers(document: &DocumentMessageHandler, first_layer: LayerNodeIde
|
||||
delete_children: false,
|
||||
});
|
||||
|
||||
// Add a flatten vector elements node after the merge
|
||||
// Add a Flatten Path node after the merge
|
||||
let flatten_node_id = NodeId::new();
|
||||
let flatten_node = document_node_definitions::resolve_document_node_type("Flatten Vector Elements")
|
||||
let flatten_node = document_node_definitions::resolve_document_node_type("Flatten Path")
|
||||
.expect("Failed to create flatten node")
|
||||
.default_node_template();
|
||||
responses.add(NodeGraphMessage::InsertNode {
|
||||
|
||||
@@ -563,7 +563,10 @@ mod test_artboard {
|
||||
pub use crate::test_utils::test_prelude::*;
|
||||
|
||||
async fn get_artboards(editor: &mut EditorTestUtils) -> Vec<graphene_core::Artboard> {
|
||||
let instrumented = editor.eval_graph().await;
|
||||
let instrumented = match editor.eval_graph().await {
|
||||
Ok(instrumented) => instrumented,
|
||||
Err(e) => panic!("Failed to evaluate graph: {}", e),
|
||||
};
|
||||
instrumented.grab_all_input::<graphene_core::append_artboard::ArtboardInput>(&editor.runtime).collect()
|
||||
}
|
||||
|
||||
|
||||
@@ -330,7 +330,10 @@ mod test_ellipse {
|
||||
}
|
||||
|
||||
async fn get_ellipse(editor: &mut EditorTestUtils) -> Vec<ResolvedEllipse> {
|
||||
let instrumented = editor.eval_graph().await;
|
||||
let instrumented = match editor.eval_graph().await {
|
||||
Ok(instrumented) => instrumented,
|
||||
Err(e) => panic!("Failed to evaluate graph: {e}"),
|
||||
};
|
||||
|
||||
let document = editor.active_document();
|
||||
let layers = document.metadata().all_layers();
|
||||
|
||||
@@ -161,7 +161,10 @@ mod test_fill {
|
||||
use graphene_std::vector::style::Fill;
|
||||
|
||||
async fn get_fills(editor: &mut EditorTestUtils) -> Vec<Fill> {
|
||||
let instrumented = editor.eval_graph().await;
|
||||
let instrumented = match editor.eval_graph().await {
|
||||
Ok(instrumented) => instrumented,
|
||||
Err(e) => panic!("Failed to evaluate graph: {e}"),
|
||||
};
|
||||
|
||||
instrumented.grab_all_input::<fill::FillInput<Fill>>(&editor.runtime).collect()
|
||||
}
|
||||
|
||||
@@ -545,7 +545,10 @@ mod test_gradient {
|
||||
use super::gradient_space_transform;
|
||||
|
||||
async fn get_fills(editor: &mut EditorTestUtils) -> Vec<(Fill, DAffine2)> {
|
||||
let instrumented = editor.eval_graph().await;
|
||||
let instrumented = match editor.eval_graph().await {
|
||||
Ok(instrumented) => instrumented,
|
||||
Err(e) => panic!("Failed to evaluate graph: {}", e),
|
||||
};
|
||||
|
||||
let document = editor.active_document();
|
||||
let layers = document.metadata().all_layers();
|
||||
|
||||
@@ -670,7 +670,9 @@ mod test_spline_tool {
|
||||
editor.handle_message(SplineToolMessage::Confirm).await;
|
||||
|
||||
// Evaluate the graph to ensure everything is processed
|
||||
editor.eval_graph().await;
|
||||
if let Err(e) = editor.eval_graph().await {
|
||||
panic!("Graph evaluation failed: {}", e);
|
||||
}
|
||||
|
||||
// Get the layer and vector data
|
||||
let document = editor.active_document();
|
||||
@@ -708,7 +710,9 @@ mod test_spline_tool {
|
||||
editor.handle_message(SplineToolMessage::Confirm).await;
|
||||
|
||||
// Evaluating the graph to ensure everything is processed
|
||||
editor.eval_graph().await;
|
||||
if let Err(e) = editor.eval_graph().await {
|
||||
panic!("Graph evaluation failed: {}", e);
|
||||
}
|
||||
|
||||
// Get the layer and vector data
|
||||
let document = editor.active_document();
|
||||
@@ -744,7 +748,9 @@ mod test_spline_tool {
|
||||
editor.handle_message(SplineToolMessage::Confirm).await;
|
||||
|
||||
// Evaluating the graph to ensure everything is processed
|
||||
editor.eval_graph().await;
|
||||
if let Err(e) = editor.eval_graph().await {
|
||||
panic!("Graph evaluation failed: {}", e);
|
||||
}
|
||||
|
||||
// Get the layer and vector data
|
||||
let document = editor.active_document();
|
||||
@@ -781,7 +787,9 @@ mod test_spline_tool {
|
||||
editor.click_tool(ToolType::Spline, MouseKeys::LEFT, DVec2::new(150.0, 100.0), ModifierKeys::empty()).await;
|
||||
|
||||
editor.handle_message(SplineToolMessage::Confirm).await;
|
||||
editor.eval_graph().await;
|
||||
if let Err(e) = editor.eval_graph().await {
|
||||
panic!("Graph evaluation failed: {}", e);
|
||||
}
|
||||
|
||||
// Get the layer and vector data
|
||||
let document = editor.active_document();
|
||||
|
||||
Reference in New Issue
Block a user