Skip to content

Commit ffc6c55

Browse files
authored
Extract gpath_bool from mod gstd::ops path_bool-related nodes (#2762)
* cargo shear * Extract `gpath_bool` from `mod gstd::ops` path_bool-related nodes
1 parent 9cf8d2c commit ffc6c55

File tree

25 files changed

+128
-107
lines changed

25 files changed

+128
-107
lines changed

Cargo.lock

Lines changed: 18 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ members = [
77
"node-graph/gapplication-io",
88
"node-graph/gcore",
99
"node-graph/gstd",
10+
"node-graph/gpath-bool",
1011
"node-graph/graph-craft",
1112
"node-graph/graphene-cli",
1213
"node-graph/interpreted-executor",
@@ -23,6 +24,7 @@ default-members = [
2324
"frontend/wasm",
2425
"node-graph/gcore",
2526
"node-graph/gstd",
27+
"node-graph/gpath-bool",
2628
"node-graph/graph-craft",
2729
"node-graph/graphene-cli",
2830
"node-graph/interpreted-executor",
@@ -39,6 +41,7 @@ math-parser = { path = "libraries/math-parser" }
3941
path-bool = { path = "libraries/path-bool" }
4042
graphene-application-io = { path = "node-graph/gapplication-io" }
4143
graphene-core = { path = "node-graph/gcore" }
44+
graphene-path-bool = { path = "node-graph/gpath-bool" }
4245
graph-craft = { path = "node-graph/graph-craft" }
4346
graphene-std = { path = "node-graph/gstd" }
4447
interpreted-executor = { path = "node-graph/interpreted-executor" }

editor/src/messages/portfolio/document/document_message_handler.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ use glam::{DAffine2, DVec2, IVec2};
3030
use graph_craft::document::value::TaggedValue;
3131
use graph_craft::document::{NodeId, NodeInput, NodeNetwork, OldNodeNetwork};
3232
use graphene_std::math::quad::Quad;
33+
use graphene_std::path_bool::{boolean_intersect, path_bool_lib};
3334
use graphene_std::raster::BlendMode;
3435
use graphene_std::raster_types::{Raster, RasterDataTable};
36+
use graphene_std::vector::PointId;
3537
use graphene_std::vector::click_target::{ClickTarget, ClickTargetType};
3638
use graphene_std::vector::style::ViewMode;
37-
use graphene_std::vector::{PointId, path_bool_lib};
3839
use std::time::Duration;
3940

4041
pub struct DocumentMessageData<'a> {
@@ -2962,7 +2963,7 @@ impl<'a> ClickXRayIter<'a> {
29622963
// We do this on this using the target area to reduce computation (as the target area is usually very simple).
29632964
if clip && intersects {
29642965
let clip_path = click_targets_to_path_lib_segments(click_targets.iter().flat_map(|x| x.iter()), transform);
2965-
let subtracted = graphene_std::vector::boolean_intersect(path, clip_path).into_iter().flatten().collect::<Vec<_>>();
2966+
let subtracted = boolean_intersect(path, clip_path).into_iter().flatten().collect::<Vec<_>>();
29662967
if subtracted.is_empty() {
29672968
use_children = false;
29682969
} else {

editor/src/messages/portfolio/document/graph_operation/graph_operation_message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pub enum GraphOperationMessage {
7979
},
8080
NewBooleanOperationLayer {
8181
id: NodeId,
82-
operation: graphene_std::vector::misc::BooleanOperation,
82+
operation: graphene_std::path_bool::BooleanOperation,
8383
parent: LayerNodeIdentifier,
8484
insert_index: usize,
8585
},

editor/src/messages/portfolio/document/graph_operation/graph_operation_message_handler.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ use glam::{DAffine2, DVec2, IVec2};
1010
use graph_craft::document::{NodeId, NodeInput};
1111
use graphene_std::Color;
1212
use graphene_std::renderer::Quad;
13+
use graphene_std::renderer::convert_usvg_path::convert_usvg_path;
1314
use graphene_std::text::{Font, TypesettingConfig};
14-
use graphene_std::vector::convert_usvg_path;
1515
use graphene_std::vector::style::{Fill, Gradient, GradientStops, GradientType, PaintOrder, Stroke, StrokeAlign, StrokeCap, StrokeJoin};
1616

1717
#[derive(Debug, Clone)]

editor/src/messages/portfolio/document/graph_operation/utility_types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<'a> ModifyInputsContext<'a> {
134134
LayerNodeIdentifier::new(new_id, self.network_interface, &[])
135135
}
136136

137-
pub fn insert_boolean_data(&mut self, operation: graphene_std::vector::misc::BooleanOperation, layer: LayerNodeIdentifier) {
137+
pub fn insert_boolean_data(&mut self, operation: graphene_std::path_bool::BooleanOperation, layer: LayerNodeIdentifier) {
138138
let boolean = resolve_document_node_type("Boolean Operation").expect("Boolean node does not exist").node_template_input_override([
139139
Some(NodeInput::value(TaggedValue::GraphicGroup(graphene_std::GraphicGroupTable::default()), true)),
140140
Some(NodeInput::value(TaggedValue::BooleanOperation(operation), false)),

editor/src/messages/portfolio/document/node_graph/document_node_definitions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
17341734
nodes: vec![
17351735
DocumentNode {
17361736
inputs: vec![NodeInput::network(concrete!(VectorDataTable), 0), NodeInput::network(concrete!(vector::style::Fill), 1)],
1737-
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_std::vector::BooleanOperationNode")),
1737+
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_path_bool::BooleanOperationNode")),
17381738
manual_composition: Some(generic!(T)),
17391739
..Default::default()
17401740
},
@@ -1765,7 +1765,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
17651765
}),
17661766
inputs: vec![
17671767
NodeInput::value(TaggedValue::GraphicGroup(GraphicGroupTable::default()), true),
1768-
NodeInput::value(TaggedValue::BooleanOperation(vector::misc::BooleanOperation::Union), false),
1768+
NodeInput::value(TaggedValue::BooleanOperation(path_bool::BooleanOperation::Union), false),
17691769
],
17701770
..Default::default()
17711771
},

editor/src/messages/portfolio/document/node_graph/node_properties.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use graph_craft::document::value::TaggedValue;
1313
use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput};
1414
use graphene_std::animation::RealTimeMode;
1515
use graphene_std::ops::XY;
16+
use graphene_std::path_bool::BooleanOperation;
1617
use graphene_std::raster::curve::Curve;
1718
use graphene_std::raster::{
1819
BlendMode, CellularDistanceFunction, CellularReturnType, Color, DomainWarpType, FractalType, LuminanceCalculation, NoiseType, RedGreenBlue, RedGreenBlueAlpha, RelativeAbsolute,
@@ -22,8 +23,8 @@ use graphene_std::raster_types::{CPU, GPU, RasterDataTable};
2223
use graphene_std::text::Font;
2324
use graphene_std::transform::{Footprint, ReferencePoint};
2425
use graphene_std::vector::VectorDataTable;
26+
use graphene_std::vector::misc::GridType;
2527
use graphene_std::vector::misc::{ArcType, MergeByDistanceAlgorithm};
26-
use graphene_std::vector::misc::{BooleanOperation, GridType};
2728
use graphene_std::vector::misc::{CentroidType, PointSpacingType};
2829
use graphene_std::vector::style::{Fill, FillChoice, FillType, GradientStops};
2930
use graphene_std::vector::style::{GradientType, PaintOrder, StrokeAlign, StrokeCap, StrokeJoin};

editor/src/messages/portfolio/document/utility_types/misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,5 +693,5 @@ impl PTZ {
693693
#[derive(Clone, Copy, Debug, PartialEq, serde::Serialize, serde::Deserialize)]
694694
pub enum GroupFolderType {
695695
Layer,
696-
BooleanOperation(graphene_std::vector::misc::BooleanOperation),
696+
BooleanOperation(graphene_std::path_bool::BooleanOperation),
697697
}

editor/src/messages/portfolio/document_migration.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const REPLACEMENTS: &[(&str, &str)] = &[
7070
("graphene_core::transform::CullNode", "graphene_core::ops::IdentityNode"),
7171
("graphene_std::raster::MaskImageNode", "graphene_std::raster::MaskNode"),
7272
("graphene_core::vector::FlattenVectorElementsNode", "graphene_core::vector::FlattenPathNode"),
73+
("graphene_std::vector::BooleanOperationNode", "graphene_path_bool::BooleanOperationNode"),
7374
];
7475

7576
pub fn document_migration_string_preprocessing(document_serialized_content: String) -> String {

0 commit comments

Comments
 (0)