Bulk rename gcore -> gstd in editor (#2729)

* remove `gcore` dependency from `editor`

* editor: bulk rename `gcore` -> `gstd`, cargo fmt
This commit is contained in:
Firestar99
2025-06-19 20:28:17 -07:00
committed by Keavon Chambers
parent 13226f7049
commit 6b69a75391
62 changed files with 198 additions and 201 deletions
Generated
-1
View File
@@ -2264,7 +2264,6 @@ dependencies = [
"futures", "futures",
"glam", "glam",
"graph-craft", "graph-craft",
"graphene-core",
"graphene-std", "graphene-std",
"graphite-proc-macros", "graphite-proc-macros",
"image", "image",
+2 -3
View File
@@ -15,13 +15,13 @@ default = ["wasm"]
wasm = ["wasm-bindgen", "graphene-std/wasm", "wasm-bindgen-futures"] wasm = ["wasm-bindgen", "graphene-std/wasm", "wasm-bindgen-futures"]
gpu = [ gpu = [
"interpreted-executor/gpu", "interpreted-executor/gpu",
"graphene-core/gpu", "graphene-std/gpu",
"wgpu-executor", "wgpu-executor",
] ]
tauri = ["ron", "decouple-execution"] tauri = ["ron", "decouple-execution"]
decouple-execution = [] decouple-execution = []
resvg = ["graphene-std/resvg"] resvg = ["graphene-std/resvg"]
vello = ["graphene-std/vello", "resvg", "graphene-core/vello"] vello = ["graphene-std/vello", "resvg"]
ron = ["dep:ron"] ron = ["dep:ron"]
[dependencies] [dependencies]
@@ -31,7 +31,6 @@ graph-craft = { path = "../node-graph/graph-craft" }
interpreted-executor = { path = "../node-graph/interpreted-executor", features = [ interpreted-executor = { path = "../node-graph/interpreted-executor", features = [
"serde", "serde",
] } ] }
graphene-core = { path = "../node-graph/gcore" }
graphene-std = { path = "../node-graph/gstd", features = ["serde"] } graphene-std = { path = "../node-graph/gstd", features = ["serde"] }
# Workspace dependencies # Workspace dependencies
+1 -1
View File
@@ -1,6 +1,6 @@
use crate::dispatcher::Dispatcher; use crate::dispatcher::Dispatcher;
use crate::messages::prelude::*; use crate::messages::prelude::*;
pub use graphene_core::uuid::*; pub use graphene_std::uuid::*;
// TODO: serialize with serde to save the current editor state // TODO: serialize with serde to save the current editor state
pub struct Editor { pub struct Editor {
+1 -1
View File
@@ -6,4 +6,4 @@ pub use animation_message::{AnimationMessage, AnimationMessageDiscriminant};
#[doc(inline)] #[doc(inline)]
pub use animation_message_handler::AnimationMessageHandler; pub use animation_message_handler::AnimationMessageHandler;
pub use graphene_core::application_io::TimingInformation; pub use graphene_std::application_io::TimingInformation;
@@ -26,7 +26,7 @@ impl MessageHandler<NewDocumentDialogMessage, ()> for NewDocumentDialogMessageHa
responses.add(Message::StartBuffer); responses.add(Message::StartBuffer);
responses.add(GraphOperationMessage::NewArtboard { responses.add(GraphOperationMessage::NewArtboard {
id: NodeId::new(), id: NodeId::new(),
artboard: graphene_core::Artboard::new(IVec2::ZERO, self.dimensions.as_ivec2()), artboard: graphene_std::Artboard::new(IVec2::ZERO, self.dimensions.as_ivec2()),
}); });
} }
@@ -7,8 +7,8 @@ use crate::messages::portfolio::document::utility_types::nodes::{JsRawBuffer, La
use crate::messages::prelude::*; use crate::messages::prelude::*;
use crate::messages::tool::utility_types::HintData; use crate::messages::tool::utility_types::HintData;
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graphene_core::raster::color::Color; use graphene_std::raster::color::Color;
use graphene_core::text::Font; use graphene_std::text::Font;
#[impl_message(Message, Frontend)] #[impl_message(Message, Frontend)]
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, specta::Type)] #[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, specta::Type)]
@@ -1,8 +1,8 @@
use crate::messages::input_mapper::utility_types::input_keyboard::KeysGroup; use crate::messages::input_mapper::utility_types::input_keyboard::KeysGroup;
use crate::messages::layout::utility_types::widget_prelude::*; use crate::messages::layout::utility_types::widget_prelude::*;
use crate::messages::prelude::*; use crate::messages::prelude::*;
use graphene_core::raster::color::Color; use graphene_std::raster::color::Color;
use graphene_core::text::Font; use graphene_std::text::Font;
use graphene_std::vector::style::{FillChoice, GradientStops}; use graphene_std::vector::style::{FillChoice, GradientStops};
use serde_json::Value; use serde_json::Value;
@@ -1,8 +1,8 @@
use crate::messages::input_mapper::utility_types::misc::ActionKeys; use crate::messages::input_mapper::utility_types::misc::ActionKeys;
use crate::messages::layout::utility_types::widget_prelude::*; use crate::messages::layout::utility_types::widget_prelude::*;
use derivative::*; use derivative::*;
use graphene_core::Color; use graphene_std::Color;
use graphene_core::raster::curve::Curve; use graphene_std::raster::curve::Curve;
use graphene_std::transform::ReferencePoint; use graphene_std::transform::ReferencePoint;
use graphite_proc_macros::WidgetBuilder; use graphite_proc_macros::WidgetBuilder;
use once_cell::sync::OnceCell; use once_cell::sync::OnceCell;
@@ -56,7 +56,7 @@ pub struct CheckboxId(Arc<OnceCell<u64>>);
impl CheckboxId { impl CheckboxId {
pub fn fill(&mut self) { pub fn fill(&mut self) {
let _ = self.0.set(graphene_core::uuid::generate_uuid()); let _ = self.0.set(graphene_std::uuid::generate_uuid());
} }
} }
impl specta::Type for CheckboxId { impl specta::Type for CheckboxId {
@@ -8,12 +8,12 @@ use crate::messages::portfolio::utility_types::PanelType;
use crate::messages::prelude::*; use crate::messages::prelude::*;
use glam::DAffine2; use glam::DAffine2;
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graphene_core::Color; use graphene_std::Color;
use graphene_core::raster::BlendMode; use graphene_std::raster::BlendMode;
use graphene_core::raster::Image; use graphene_std::raster::Image;
use graphene_core::vector::style::ViewMode;
use graphene_std::renderer::ClickTarget; use graphene_std::renderer::ClickTarget;
use graphene_std::transform::Footprint; use graphene_std::transform::Footprint;
use graphene_std::vector::style::ViewMode;
#[impl_message(Message, PortfolioMessage, Document)] #[impl_message(Message, PortfolioMessage, Document)]
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)] #[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
@@ -29,11 +29,10 @@ use bezier_rs::Subpath;
use glam::{DAffine2, DVec2, IVec2}; use glam::{DAffine2, DVec2, IVec2};
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeInput, NodeNetwork, OldNodeNetwork}; use graph_craft::document::{NodeId, NodeInput, NodeNetwork, OldNodeNetwork};
use graphene_core::raster::BlendMode; use graphene_std::raster::BlendMode;
use graphene_core::raster_types::RasterDataTable; use graphene_std::raster_types::{Raster, RasterDataTable};
use graphene_core::vector::style::ViewMode;
use graphene_std::raster_types::Raster;
use graphene_std::renderer::{ClickTarget, ClickTargetType, Quad}; use graphene_std::renderer::{ClickTarget, ClickTargetType, Quad};
use graphene_std::vector::style::ViewMode;
use graphene_std::vector::{PointId, path_bool_lib}; use graphene_std::vector::{PointId, path_bool_lib};
use std::time::Duration; use std::time::Duration;
@@ -1593,7 +1592,7 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
impl DocumentMessageHandler { impl DocumentMessageHandler {
/// Runs an intersection test with all layers and a viewport space quad /// Runs an intersection test with all layers and a viewport space quad
pub fn intersect_quad<'a>(&'a self, viewport_quad: graphene_core::renderer::Quad, ipp: &InputPreprocessorMessageHandler) -> impl Iterator<Item = LayerNodeIdentifier> + use<'a> { pub fn intersect_quad<'a>(&'a self, viewport_quad: graphene_std::renderer::Quad, ipp: &InputPreprocessorMessageHandler) -> impl Iterator<Item = LayerNodeIdentifier> + use<'a> {
let document_to_viewport = self.navigation_handler.calculate_offset_transform(ipp.viewport_bounds.center(), &self.document_ptz); let document_to_viewport = self.navigation_handler.calculate_offset_transform(ipp.viewport_bounds.center(), &self.document_ptz);
let document_quad = document_to_viewport.inverse() * viewport_quad; let document_quad = document_to_viewport.inverse() * viewport_quad;
@@ -1601,7 +1600,7 @@ impl DocumentMessageHandler {
} }
/// Runs an intersection test with all layers and a viewport space quad; ignoring artboards /// Runs an intersection test with all layers and a viewport space quad; ignoring artboards
pub fn intersect_quad_no_artboards<'a>(&'a self, viewport_quad: graphene_core::renderer::Quad, ipp: &InputPreprocessorMessageHandler) -> impl Iterator<Item = LayerNodeIdentifier> + use<'a> { pub fn intersect_quad_no_artboards<'a>(&'a self, viewport_quad: graphene_std::renderer::Quad, ipp: &InputPreprocessorMessageHandler) -> impl Iterator<Item = LayerNodeIdentifier> + use<'a> {
self.intersect_quad(viewport_quad, ipp).filter(|layer| !self.network_interface.is_artboard(&layer.to_node(), &[])) self.intersect_quad(viewport_quad, ipp).filter(|layer| !self.network_interface.is_artboard(&layer.to_node(), &[]))
} }
@@ -1618,7 +1617,7 @@ impl DocumentMessageHandler {
self.intersect_polygon(viewport_polygon, ipp).filter(|layer| !self.network_interface.is_artboard(&layer.to_node(), &[])) self.intersect_polygon(viewport_polygon, ipp).filter(|layer| !self.network_interface.is_artboard(&layer.to_node(), &[]))
} }
pub fn is_layer_fully_inside(&self, layer: &LayerNodeIdentifier, quad: graphene_core::renderer::Quad) -> bool { pub fn is_layer_fully_inside(&self, layer: &LayerNodeIdentifier, quad: graphene_std::renderer::Quad) -> bool {
// Get the bounding box of the layer in document space // Get the bounding box of the layer in document space
let Some(bounding_box) = self.metadata().bounding_box_viewport(*layer) else { return false }; let Some(bounding_box) = self.metadata().bounding_box_viewport(*layer) else { return false };
@@ -1712,7 +1711,7 @@ impl DocumentMessageHandler {
.selected_nodes() .selected_nodes()
.selected_visible_layers(&self.network_interface) .selected_visible_layers(&self.network_interface)
.filter_map(|layer| self.metadata().bounding_box_viewport(layer)) .filter_map(|layer| self.metadata().bounding_box_viewport(layer))
.reduce(graphene_core::renderer::Quad::combine_bounds) .reduce(graphene_std::renderer::Quad::combine_bounds)
} }
pub fn selected_visible_and_unlock_layers_bounding_box_viewport(&self) -> Option<[DVec2; 2]> { pub fn selected_visible_and_unlock_layers_bounding_box_viewport(&self) -> Option<[DVec2; 2]> {
@@ -1720,7 +1719,7 @@ impl DocumentMessageHandler {
.selected_nodes() .selected_nodes()
.selected_visible_and_unlocked_layers(&self.network_interface) .selected_visible_and_unlocked_layers(&self.network_interface)
.filter_map(|layer| self.metadata().bounding_box_viewport(layer)) .filter_map(|layer| self.metadata().bounding_box_viewport(layer))
.reduce(graphene_core::renderer::Quad::combine_bounds) .reduce(graphene_std::renderer::Quad::combine_bounds)
} }
pub fn document_network(&self) -> &NodeNetwork { pub fn document_network(&self) -> &NodeNetwork {
@@ -2892,7 +2891,7 @@ impl DocumentMessageHandler {
/// Create a network interface with a single export /// Create a network interface with a single export
fn default_document_network_interface() -> NodeNetworkInterface { fn default_document_network_interface() -> NodeNetworkInterface {
let mut network_interface = NodeNetworkInterface::default(); let mut network_interface = NodeNetworkInterface::default();
network_interface.add_export(TaggedValue::ArtboardGroup(graphene_core::ArtboardGroupTable::default()), -1, "", &[]); network_interface.add_export(TaggedValue::ArtboardGroup(graphene_std::ArtboardGroupTable::default()), -1, "", &[]);
network_interface network_interface
} }
@@ -5,14 +5,14 @@ use crate::messages::prelude::*;
use bezier_rs::Subpath; use bezier_rs::Subpath;
use glam::{DAffine2, DVec2, IVec2}; use glam::{DAffine2, DVec2, IVec2};
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graphene_core::Artboard; use graphene_std::Artboard;
use graphene_core::raster::BlendMode; use graphene_std::raster::BlendMode;
use graphene_core::raster_types::{CPU, RasterDataTable}; use graphene_std::raster_types::{CPU, RasterDataTable};
use graphene_core::text::{Font, TypesettingConfig}; use graphene_std::text::{Font, TypesettingConfig};
use graphene_core::vector::PointId; use graphene_std::vector::PointId;
use graphene_core::vector::VectorModificationType; use graphene_std::vector::VectorModificationType;
use graphene_core::vector::brush_stroke::BrushStroke; use graphene_std::vector::brush_stroke::BrushStroke;
use graphene_core::vector::style::{Fill, Stroke}; use graphene_std::vector::style::{Fill, Stroke};
#[impl_message(Message, DocumentMessage, GraphOperation)] #[impl_message(Message, DocumentMessage, GraphOperation)]
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)] #[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
@@ -8,11 +8,11 @@ use crate::messages::prelude::*;
use crate::messages::tool::common_functionality::graph_modification_utils::get_clip_mode; use crate::messages::tool::common_functionality::graph_modification_utils::get_clip_mode;
use glam::{DAffine2, DVec2, IVec2}; use glam::{DAffine2, DVec2, IVec2};
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::Color; use graphene_std::Color;
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::text::{Font, TypesettingConfig}; use graphene_std::text::{Font, TypesettingConfig};
use graphene_core::vector::style::{Fill, Gradient, GradientStops, GradientType, PaintOrder, Stroke, StrokeAlign, StrokeCap, StrokeJoin};
use graphene_std::vector::convert_usvg_path; use graphene_std::vector::convert_usvg_path;
use graphene_std::vector::style::{Fill, Gradient, GradientStops, GradientType, PaintOrder, Stroke, StrokeAlign, StrokeCap, StrokeJoin};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
struct ArtboardInfo { struct ArtboardInfo {
@@ -374,7 +374,7 @@ fn import_usvg_node(modify_inputs: &mut ModifyInputsContext, node: &usvg::Node,
warn!("Skip image") warn!("Skip image")
} }
usvg::Node::Text(text) => { usvg::Node::Text(text) => {
let font = Font::new(graphene_core::consts::DEFAULT_FONT_FAMILY.to_string(), graphene_core::consts::DEFAULT_FONT_STYLE.to_string()); let font = Font::new(graphene_std::consts::DEFAULT_FONT_FAMILY.to_string(), graphene_std::consts::DEFAULT_FONT_STYLE.to_string());
modify_inputs.insert_text(text.chunks().iter().map(|chunk| chunk.text()).collect(), font, TypesettingConfig::default(), layer); modify_inputs.insert_text(text.chunks().iter().map(|chunk| chunk.text()).collect(), font, TypesettingConfig::default(), layer);
modify_inputs.fill_set(Fill::Solid(Color::BLACK)); modify_inputs.fill_set(Fill::Solid(Color::BLACK));
} }
@@ -3,7 +3,7 @@ use bezier_rs::Subpath;
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::vector::PointId; use graphene_std::vector::PointId;
/// Convert an affine transform into the tuple `(scale, angle, translation, shear)` assuming `shear.y = 0`. /// Convert an affine transform into the tuple `(scale, angle, translation, shear)` assuming `shear.y = 0`.
pub fn compute_scale_angle_translation_shear(transform: DAffine2) -> (DVec2, f64, DVec2, DVec2) { pub fn compute_scale_angle_translation_shear(transform: DAffine2) -> (DVec2, f64, DVec2, DVec2) {
@@ -8,13 +8,13 @@ use glam::{DAffine2, DVec2, IVec2};
use graph_craft::concrete; use graph_craft::concrete;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::Artboard; use graphene_std::Artboard;
use graphene_core::raster::BlendMode; use graphene_std::raster::BlendMode;
use graphene_core::raster_types::{CPU, RasterDataTable}; use graphene_std::raster_types::{CPU, RasterDataTable};
use graphene_core::text::{Font, TypesettingConfig}; use graphene_std::text::{Font, TypesettingConfig};
use graphene_core::vector::brush_stroke::BrushStroke; use graphene_std::vector::brush_stroke::BrushStroke;
use graphene_core::vector::style::{Fill, Stroke}; use graphene_std::vector::style::{Fill, Stroke};
use graphene_core::vector::{PointId, VectorModificationType}; use graphene_std::vector::{PointId, VectorModificationType};
use graphene_std::vector::{VectorData, VectorDataTable}; use graphene_std::vector::{VectorData, VectorDataTable};
use graphene_std::{GraphicGroupTable, NodeInputDecleration}; use graphene_std::{GraphicGroupTable, NodeInputDecleration};
@@ -124,7 +124,7 @@ impl<'a> ModifyInputsContext<'a> {
pub fn create_artboard(&mut self, new_id: NodeId, artboard: Artboard) -> LayerNodeIdentifier { pub fn create_artboard(&mut self, new_id: NodeId, artboard: Artboard) -> LayerNodeIdentifier {
let artboard_node_template = resolve_document_node_type("Artboard").expect("Node").node_template_input_override([ let artboard_node_template = resolve_document_node_type("Artboard").expect("Node").node_template_input_override([
Some(NodeInput::value(TaggedValue::ArtboardGroup(graphene_std::ArtboardGroupTable::default()), true)), Some(NodeInput::value(TaggedValue::ArtboardGroup(graphene_std::ArtboardGroupTable::default()), true)),
Some(NodeInput::value(TaggedValue::GraphicGroup(graphene_core::GraphicGroupTable::default()), true)), Some(NodeInput::value(TaggedValue::GraphicGroup(graphene_std::GraphicGroupTable::default()), true)),
Some(NodeInput::value(TaggedValue::IVec2(artboard.location), false)), Some(NodeInput::value(TaggedValue::IVec2(artboard.location), false)),
Some(NodeInput::value(TaggedValue::IVec2(artboard.dimensions), false)), Some(NodeInput::value(TaggedValue::IVec2(artboard.dimensions), false)),
Some(NodeInput::value(TaggedValue::Color(artboard.background), false)), Some(NodeInput::value(TaggedValue::Color(artboard.background), false)),
@@ -14,14 +14,14 @@ use graph_craft::ProtoNodeIdentifier;
use graph_craft::concrete; use graph_craft::concrete;
use graph_craft::document::value::*; use graph_craft::document::value::*;
use graph_craft::document::*; use graph_craft::document::*;
use graphene_core::raster::brush_cache::BrushCache;
use graphene_core::raster::{CellularDistanceFunction, CellularReturnType, Color, DomainWarpType, FractalType, NoiseType, RedGreenBlueAlpha};
use graphene_core::raster_types::{CPU, RasterDataTable};
use graphene_core::text::{Font, TypesettingConfig};
use graphene_core::transform::Footprint;
use graphene_core::vector::VectorDataTable;
use graphene_core::*;
use graphene_std::ops::XY; use graphene_std::ops::XY;
use graphene_std::raster::brush_cache::BrushCache;
use graphene_std::raster::{CellularDistanceFunction, CellularReturnType, Color, DomainWarpType, FractalType, NoiseType, RedGreenBlueAlpha};
use graphene_std::raster_types::{CPU, RasterDataTable};
use graphene_std::text::{Font, TypesettingConfig};
use graphene_std::transform::Footprint;
use graphene_std::vector::VectorDataTable;
use graphene_std::*;
use std::collections::{HashMap, HashSet, VecDeque}; use std::collections::{HashMap, HashSet, VecDeque};
pub struct NodePropertiesContext<'a> { pub struct NodePropertiesContext<'a> {
@@ -370,7 +370,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
DocumentNode { DocumentNode {
manual_composition: Some(concrete!(Context)), manual_composition: Some(concrete!(Context)),
inputs: vec![ inputs: vec![
NodeInput::network(graphene_core::Type::Fn(Box::new(concrete!(Context)), Box::new(concrete!(ArtboardGroupTable))), 0), NodeInput::network(graphene_std::Type::Fn(Box::new(concrete!(Context)), Box::new(concrete!(ArtboardGroupTable))), 0),
NodeInput::node(NodeId(1), 0), NodeInput::node(NodeId(1), 0),
NodeInput::Reflection(graph_craft::document::DocumentNodeMetadata::DocumentNodePath), NodeInput::Reflection(graph_craft::document::DocumentNodeMetadata::DocumentNodePath),
], ],
@@ -1028,7 +1028,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
nodes: vec![DocumentNode { nodes: vec![DocumentNode {
inputs: vec![ inputs: vec![
NodeInput::network(concrete!(RasterDataTable<CPU>), 0), NodeInput::network(concrete!(RasterDataTable<CPU>), 0),
NodeInput::network(concrete!(Vec<graphene_core::vector::brush_stroke::BrushStroke>), 1), NodeInput::network(concrete!(Vec<graphene_std::vector::brush_stroke::BrushStroke>), 1),
NodeInput::network(concrete!(BrushCache), 2), NodeInput::network(concrete!(BrushCache), 2),
], ],
manual_composition: Some(concrete!(Context)), manual_composition: Some(concrete!(Context)),
@@ -1481,7 +1481,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
..Default::default() ..Default::default()
}, },
DocumentNode { DocumentNode {
inputs: vec![NodeInput::node(NodeId(0), 0), NodeInput::network(concrete!(graphene_core::vector::VectorModification), 1)], inputs: vec![NodeInput::node(NodeId(0), 0), NodeInput::network(concrete!(graphene_std::vector::VectorModification), 1)],
manual_composition: Some(generic!(T)), manual_composition: Some(generic!(T)),
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::vector::vector_data::modification::PathModifyNode")), implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::vector::vector_data::modification::PathModifyNode")),
..Default::default() ..Default::default()
@@ -1547,7 +1547,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
NodeInput::scope("editor-api"), NodeInput::scope("editor-api"),
NodeInput::value(TaggedValue::String("Lorem ipsum".to_string()), false), NodeInput::value(TaggedValue::String("Lorem ipsum".to_string()), false),
NodeInput::value( NodeInput::value(
TaggedValue::Font(Font::new(graphene_core::consts::DEFAULT_FONT_FAMILY.into(), graphene_core::consts::DEFAULT_FONT_STYLE.into())), TaggedValue::Font(Font::new(graphene_std::consts::DEFAULT_FONT_FAMILY.into(), graphene_std::consts::DEFAULT_FONT_STYLE.into())),
false, false,
), ),
NodeInput::value(TaggedValue::F64(TypesettingConfig::default().font_size), false), NodeInput::value(TaggedValue::F64(TypesettingConfig::default().font_size), false),
@@ -1830,14 +1830,14 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
exports: vec![NodeInput::node(NodeId(4), 0)], // Taken from output 0 of Sample Points exports: vec![NodeInput::node(NodeId(4), 0)], // Taken from output 0 of Sample Points
nodes: [ nodes: [
DocumentNode { DocumentNode {
inputs: vec![NodeInput::network(concrete!(graphene_core::vector::VectorDataTable), 0)], inputs: vec![NodeInput::network(concrete!(graphene_std::vector::VectorDataTable), 0)],
implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::vector::SubpathSegmentLengthsNode")), implementation: DocumentNodeImplementation::ProtoNode(ProtoNodeIdentifier::new("graphene_core::vector::SubpathSegmentLengthsNode")),
manual_composition: Some(generic!(T)), manual_composition: Some(generic!(T)),
..Default::default() ..Default::default()
}, },
DocumentNode { DocumentNode {
inputs: vec![ inputs: vec![
NodeInput::network(concrete!(graphene_core::vector::VectorDataTable), 0), NodeInput::network(concrete!(graphene_std::vector::VectorDataTable), 0),
NodeInput::network(concrete!(f64), 1), // From the document node's parameters NodeInput::network(concrete!(f64), 1), // From the document node's parameters
NodeInput::network(concrete!(f64), 2), // From the document node's parameters NodeInput::network(concrete!(f64), 2), // From the document node's parameters
NodeInput::network(concrete!(f64), 3), // From the document node's parameters NodeInput::network(concrete!(f64), 3), // From the document node's parameters
@@ -1874,7 +1874,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
..Default::default() ..Default::default()
}), }),
inputs: vec![ inputs: vec![
NodeInput::value(TaggedValue::VectorData(graphene_core::vector::VectorDataTable::default()), true), NodeInput::value(TaggedValue::VectorData(graphene_std::vector::VectorDataTable::default()), true),
NodeInput::value(TaggedValue::F64(100.), false), NodeInput::value(TaggedValue::F64(100.), false),
NodeInput::value(TaggedValue::F64(0.), false), NodeInput::value(TaggedValue::F64(0.), false),
NodeInput::value(TaggedValue::F64(0.), false), NodeInput::value(TaggedValue::F64(0.), false),
@@ -1983,7 +1983,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
nodes: [ nodes: [
DocumentNode { DocumentNode {
inputs: vec![ inputs: vec![
NodeInput::network(concrete!(graphene_core::vector::VectorDataTable), 0), NodeInput::network(concrete!(graphene_std::vector::VectorDataTable), 0),
NodeInput::network(concrete!(f64), 1), NodeInput::network(concrete!(f64), 1),
NodeInput::network(concrete!(u32), 2), NodeInput::network(concrete!(u32), 2),
], ],
@@ -2017,7 +2017,7 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
..Default::default() ..Default::default()
}), }),
inputs: vec![ inputs: vec![
NodeInput::value(TaggedValue::VectorData(graphene_core::vector::VectorDataTable::default()), true), NodeInput::value(TaggedValue::VectorData(graphene_std::vector::VectorDataTable::default()), true),
NodeInput::value(TaggedValue::F64(10.), false), NodeInput::value(TaggedValue::F64(10.), false),
NodeInput::value(TaggedValue::U32(0), false), NodeInput::value(TaggedValue::U32(0), false),
], ],
@@ -2112,9 +2112,9 @@ fn static_nodes() -> Vec<DocumentNodeDefinition> {
} }
}; };
} }
let node_registry = graphene_core::registry::NODE_REGISTRY.lock().unwrap(); let node_registry = graphene_std::registry::NODE_REGISTRY.lock().unwrap();
'outer: for (id, metadata) in graphene_core::registry::NODE_METADATA.lock().unwrap().iter() { 'outer: for (id, metadata) in graphene_std::registry::NODE_METADATA.lock().unwrap().iter() {
use graphene_core::registry::*; use graphene_std::registry::*;
let id = id.clone(); let id = id.clone();
for node in custom.iter() { for node in custom.iter() {
@@ -2900,8 +2900,8 @@ pub fn collect_node_types() -> Vec<FrontendNodeType> {
.collect(); .collect();
let mut extracted_node_types = Vec::new(); let mut extracted_node_types = Vec::new();
let node_registry = graphene_core::registry::NODE_REGISTRY.lock().unwrap(); let node_registry = graphene_std::registry::NODE_REGISTRY.lock().unwrap();
let node_metadata = graphene_core::registry::NODE_METADATA.lock().unwrap(); let node_metadata = graphene_std::registry::NODE_METADATA.lock().unwrap();
for (id, metadata) in node_metadata.iter() { for (id, metadata) in node_metadata.iter() {
if let Some(implementations) = node_registry.get(id) { if let Some(implementations) = node_registry.get(id) {
let identifier = match id_to_identifier_map.get(id) { let identifier = match id_to_identifier_map.get(id) {
@@ -21,7 +21,7 @@ use crate::messages::tool::utility_types::{HintData, HintGroup, HintInfo};
use glam::{DAffine2, DVec2, IVec2}; use glam::{DAffine2, DVec2, IVec2};
use graph_craft::document::{DocumentNodeImplementation, NodeId, NodeInput}; use graph_craft::document::{DocumentNodeImplementation, NodeId, NodeInput};
use graph_craft::proto::GraphErrors; use graph_craft::proto::GraphErrors;
use graphene_core::*; use graphene_std::*;
use renderer::Quad; use renderer::Quad;
use std::cmp::Ordering; use std::cmp::Ordering;
@@ -11,23 +11,23 @@ use glam::{DAffine2, DVec2, IVec2, UVec2};
use graph_craft::Type; use graph_craft::Type;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput}; use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput};
use graphene_core::raster::curve::Curve; use graphene_std::animation::RealTimeMode;
use graphene_core::raster::{ use graphene_std::ops::XY;
use graphene_std::raster::curve::Curve;
use graphene_std::raster::{
BlendMode, CellularDistanceFunction, CellularReturnType, Color, DomainWarpType, FractalType, LuminanceCalculation, NoiseType, RedGreenBlue, RedGreenBlueAlpha, RelativeAbsolute, BlendMode, CellularDistanceFunction, CellularReturnType, Color, DomainWarpType, FractalType, LuminanceCalculation, NoiseType, RedGreenBlue, RedGreenBlueAlpha, RelativeAbsolute,
SelectiveColorChoice, SelectiveColorChoice,
}; };
use graphene_core::raster_types::{CPU, GPU, RasterDataTable}; use graphene_std::raster_types::{CPU, GPU, RasterDataTable};
use graphene_core::text::Font; use graphene_std::text::Font;
use graphene_core::vector::generator_nodes::grid;
use graphene_core::vector::misc::CentroidType;
use graphene_core::vector::style::{GradientType, PaintOrder, StrokeAlign, StrokeCap, StrokeJoin};
use graphene_std::animation::RealTimeMode;
use graphene_std::ops::XY;
use graphene_std::transform::{Footprint, ReferencePoint}; use graphene_std::transform::{Footprint, ReferencePoint};
use graphene_std::vector::VectorDataTable; use graphene_std::vector::VectorDataTable;
use graphene_std::vector::generator_nodes::grid;
use graphene_std::vector::misc::ArcType; use graphene_std::vector::misc::ArcType;
use graphene_std::vector::misc::CentroidType;
use graphene_std::vector::misc::{BooleanOperation, GridType}; use graphene_std::vector::misc::{BooleanOperation, GridType};
use graphene_std::vector::style::{Fill, FillChoice, FillType, GradientStops}; use graphene_std::vector::style::{Fill, FillChoice, FillType, GradientStops};
use graphene_std::vector::style::{GradientType, PaintOrder, StrokeAlign, StrokeCap, StrokeJoin};
use graphene_std::{GraphicGroupTable, NodeInputDecleration}; use graphene_std::{GraphicGroupTable, NodeInputDecleration};
pub(crate) fn string_properties(text: &str) -> Vec<LayoutGroup> { pub(crate) fn string_properties(text: &str) -> Vec<LayoutGroup> {
@@ -1414,7 +1414,7 @@ pub(crate) fn generate_node_properties(node_id: NodeId, context: &mut NodeProper
let mut unit_suffix = None; let mut unit_suffix = None;
let input_type = match implementation { let input_type = match implementation {
DocumentNodeImplementation::ProtoNode(proto_node_identifier) => 'early_return: { DocumentNodeImplementation::ProtoNode(proto_node_identifier) => 'early_return: {
if let Some(field) = graphene_core::registry::NODE_METADATA if let Some(field) = graphene_std::registry::NODE_METADATA
.lock() .lock()
.unwrap() .unwrap()
.get(&proto_node_identifier.name.clone().into_owned()) .get(&proto_node_identifier.name.clone().into_owned())
@@ -1874,7 +1874,7 @@ pub mod choice {
use crate::messages::portfolio::document::node_graph::utility_types::FrontendGraphDataType; use crate::messages::portfolio::document::node_graph::utility_types::FrontendGraphDataType;
use crate::messages::tool::tool_messages::tool_prelude::*; use crate::messages::tool::tool_messages::tool_prelude::*;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graphene_core::registry::{ChoiceTypeStatic, ChoiceWidgetHint}; use graphene_std::registry::{ChoiceTypeStatic, ChoiceWidgetHint};
use std::marker::PhantomData; use std::marker::PhantomData;
pub trait WidgetFactory { pub trait WidgetFactory {
@@ -1,7 +1,7 @@
use crate::messages::portfolio::document::utility_types::network_interface::{InputConnector, OutputConnector, TypeSource}; use crate::messages::portfolio::document::utility_types::network_interface::{InputConnector, OutputConnector, TypeSource};
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graphene_core::Type; use graphene_std::Type;
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize, specta::Type)] #[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize, specta::Type)]
pub enum FrontendGraphDataType { pub enum FrontendGraphDataType {
@@ -3,8 +3,8 @@ use crate::messages::portfolio::document::overlays::utility_types::OverlayContex
use crate::messages::portfolio::document::utility_types::misc::{GridSnapping, GridType}; use crate::messages::portfolio::document::utility_types::misc::{GridSnapping, GridType};
use crate::messages::prelude::*; use crate::messages::prelude::*;
use glam::DVec2; use glam::DVec2;
use graphene_core::raster::color::Color; use graphene_std::raster::color::Color;
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_std::vector::style::FillChoice; use graphene_std::vector::style::FillChoice;
fn grid_overlay_rectangular(document: &DocumentMessageHandler, overlay_context: &mut OverlayContext, spacing: DVec2) { fn grid_overlay_rectangular(document: &DocumentMessageHandler, overlay_context: &mut OverlayContext, spacing: DVec2) {
@@ -5,7 +5,7 @@ use crate::messages::tool::common_functionality::shape_editor::{SelectedLayerSta
use crate::messages::tool::tool_messages::tool_prelude::{DocumentMessageHandler, PreferencesMessageHandler}; use crate::messages::tool::tool_messages::tool_prelude::{DocumentMessageHandler, PreferencesMessageHandler};
use bezier_rs::{Bezier, BezierHandles}; use bezier_rs::{Bezier, BezierHandles};
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graphene_core::vector::ManipulatorPointId; use graphene_std::vector::ManipulatorPointId;
use graphene_std::vector::{PointId, SegmentId}; use graphene_std::vector::{PointId, SegmentId};
use wasm_bindgen::JsCast; use wasm_bindgen::JsCast;
@@ -8,9 +8,9 @@ use bezier_rs::{Bezier, Subpath};
use core::borrow::Borrow; use core::borrow::Borrow;
use core::f64::consts::{FRAC_PI_2, TAU}; use core::f64::consts::{FRAC_PI_2, TAU};
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graphene_core::Color; use graphene_std::Color;
use graphene_core::renderer::Quad;
use graphene_std::renderer::ClickTargetType; use graphene_std::renderer::ClickTargetType;
use graphene_std::renderer::Quad;
use graphene_std::vector::{PointId, SegmentId, VectorData}; use graphene_std::vector::{PointId, SegmentId, VectorData};
use std::collections::HashMap; use std::collections::HashMap;
use wasm_bindgen::{JsCast, JsValue}; use wasm_bindgen::{JsCast, JsValue};
@@ -3,8 +3,8 @@ use crate::messages::portfolio::document::graph_operation::transform_utils;
use crate::messages::portfolio::document::graph_operation::utility_types::ModifyInputsContext; use crate::messages::portfolio::document::graph_operation::utility_types::ModifyInputsContext;
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graphene_core::renderer::{ClickTarget, ClickTargetType, Quad}; use graphene_std::renderer::{ClickTarget, ClickTargetType, Quad};
use graphene_core::transform::Footprint; use graphene_std::transform::Footprint;
use graphene_std::vector::{PointId, VectorData}; use graphene_std::vector::{PointId, VectorData};
use std::collections::{HashMap, HashSet}; use std::collections::{HashMap, HashSet};
use std::num::NonZeroU64; use std::num::NonZeroU64;
@@ -1,4 +1,4 @@
use graphene_core::raster::color::Color; use graphene_std::raster::color::Color;
use thiserror::Error; use thiserror::Error;
/// The error type used by the Graphite editor. /// The error type used by the Graphite editor.
@@ -1,6 +1,6 @@
use crate::consts::COLOR_OVERLAY_GRAY; use crate::consts::COLOR_OVERLAY_GRAY;
use glam::DVec2; use glam::DVec2;
use graphene_core::raster::Color; use graphene_std::raster::Color;
use std::fmt; use std::fmt;
#[repr(transparent)] #[repr(transparent)]
@@ -485,7 +485,7 @@ impl NodeNetworkInterface {
InputConnector::Export(export_index) => { InputConnector::Export(export_index) => {
let Some((encapsulating_node_id, encapsulating_node_id_path)) = network_path.split_last() else { let Some((encapsulating_node_id, encapsulating_node_id_path)) = network_path.split_last() else {
// The outermost network export defaults to an ArtboardGroupTable. // The outermost network export defaults to an ArtboardGroupTable.
return Some((concrete!(graphene_core::ArtboardGroupTable), TypeSource::OuterMostExportDefault)); return Some((concrete!(graphene_std::ArtboardGroupTable), TypeSource::OuterMostExportDefault));
}; };
let output_type = self.output_types(encapsulating_node_id, encapsulating_node_id_path).into_iter().nth(export_index).flatten(); let output_type = self.output_types(encapsulating_node_id, encapsulating_node_id_path).into_iter().nth(export_index).flatten();
@@ -3131,7 +3131,7 @@ impl NodeNetworkInterface {
self.node_click_targets(node_id, network_path) self.node_click_targets(node_id, network_path)
.and_then(|transient_node_metadata| transient_node_metadata.node_click_target.bounding_box()) .and_then(|transient_node_metadata| transient_node_metadata.node_click_target.bounding_box())
}) })
.reduce(graphene_core::renderer::Quad::combine_bounds) .reduce(graphene_std::renderer::Quad::combine_bounds)
} }
/// Gets the bounding box in viewport coordinates for each node in the node graph /// Gets the bounding box in viewport coordinates for each node in the node graph
@@ -8,9 +8,9 @@ use crate::messages::tool::common_functionality::graph_modification_utils;
use crate::messages::tool::common_functionality::shape_editor::ShapeState; use crate::messages::tool::common_functionality::shape_editor::ShapeState;
use crate::messages::tool::utility_types::ToolType; use crate::messages::tool::utility_types::ToolType;
use glam::{DAffine2, DMat2, DVec2}; use glam::{DAffine2, DMat2, DVec2};
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::vector::ManipulatorPointId; use graphene_std::vector::ManipulatorPointId;
use graphene_core::vector::VectorModificationType; use graphene_std::vector::VectorModificationType;
use graphene_std::vector::{HandleId, PointId}; use graphene_std::vector::{HandleId, PointId};
use std::collections::{HashMap, VecDeque}; use std::collections::{HashMap, VecDeque};
use std::f64::consts::PI; use std::f64::consts::PI;
@@ -416,7 +416,7 @@ impl LayoutHolder for MenuBarMessageHandler {
action: MenuBarEntry::no_action(), action: MenuBarEntry::no_action(),
disabled: no_active_document || !has_selected_layers, disabled: no_active_document || !has_selected_layers,
children: MenuBarEntryChildren(vec![{ children: MenuBarEntryChildren(vec![{
let list = <BooleanOperation as graphene_core::registry::ChoiceTypeStatic>::list(); let list = <BooleanOperation as graphene_std::registry::ChoiceTypeStatic>::list();
list.into_iter() list.into_iter()
.map(|i| i.into_iter()) .map(|i| i.into_iter())
.flatten() .flatten()
@@ -3,9 +3,9 @@ use super::utility_types::PanelType;
use crate::messages::frontend::utility_types::{ExportBounds, FileType}; use crate::messages::frontend::utility_types::{ExportBounds, FileType};
use crate::messages::portfolio::document::utility_types::clipboards::Clipboard; use crate::messages::portfolio::document::utility_types::clipboards::Clipboard;
use crate::messages::prelude::*; use crate::messages::prelude::*;
use graphene_core::Color; use graphene_std::Color;
use graphene_core::raster::Image; use graphene_std::raster::Image;
use graphene_core::text::Font; use graphene_std::text::Font;
#[impl_message(Message, Portfolio)] #[impl_message(Message, Portfolio)]
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)] #[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
@@ -22,8 +22,8 @@ use bezier_rs::Subpath;
use glam::{DAffine2, DVec2, IVec2}; use glam::{DAffine2, DVec2, IVec2};
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{DocumentNodeImplementation, NodeId, NodeInput}; use graph_craft::document::{DocumentNodeImplementation, NodeId, NodeInput};
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::text::{Font, TypesettingConfig}; use graphene_std::text::{Font, TypesettingConfig};
use graphene_std::vector::style::{Fill, FillType, Gradient, PaintOrder, StrokeAlign}; use graphene_std::vector::style::{Fill, FillType, Gradient, PaintOrder, StrokeAlign};
use graphene_std::vector::{VectorData, VectorDataTable}; use graphene_std::vector::{VectorData, VectorDataTable};
use std::vec; use std::vec;
@@ -1546,7 +1546,7 @@ impl PortfolioMessageHandler {
responses.add(ToolMessage::DeactivateTools); responses.add(ToolMessage::DeactivateTools);
} else { } else {
// Load the default font upon creating the first document // Load the default font upon creating the first document
let font = Font::new(graphene_core::consts::DEFAULT_FONT_FAMILY.into(), graphene_core::consts::DEFAULT_FONT_STYLE.into()); let font = Font::new(graphene_std::consts::DEFAULT_FONT_FAMILY.into(), graphene_std::consts::DEFAULT_FONT_STYLE.into());
responses.add(FrontendMessage::TriggerFontLoad { font }); responses.add(FrontendMessage::TriggerFontLoad { font });
} }
@@ -3,14 +3,14 @@ use crate::messages::layout::utility_types::layout_widget::{Layout, LayoutGroup,
use crate::messages::prelude::*; use crate::messages::prelude::*;
use crate::messages::tool::tool_messages::tool_prelude::*; use crate::messages::tool::tool_messages::tool_prelude::*;
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graphene_core::Context;
use graphene_core::GraphicGroupTable;
use graphene_core::instances::Instances;
use graphene_core::memo::IORecord;
use graphene_core::raster::Image;
use graphene_core::vector::{VectorData, VectorDataTable};
use graphene_core::{Artboard, ArtboardGroupTable, GraphicElement};
use graphene_std::Color; use graphene_std::Color;
use graphene_std::Context;
use graphene_std::GraphicGroupTable;
use graphene_std::instances::Instances;
use graphene_std::memo::IORecord;
use graphene_std::raster::Image;
use graphene_std::vector::{VectorData, VectorDataTable};
use graphene_std::{Artboard, ArtboardGroupTable, GraphicElement};
use std::any::Any; use std::any::Any;
use std::sync::Arc; use std::sync::Arc;
@@ -1,7 +1,7 @@
use crate::messages::layout::utility_types::widget_prelude::*; use crate::messages::layout::utility_types::widget_prelude::*;
use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier; use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier;
use crate::messages::prelude::*; use crate::messages::prelude::*;
use graphene_core::Color; use graphene_std::Color;
use graphene_std::vector::style::FillChoice; use graphene_std::vector::style::FillChoice;
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, specta::Type)] #[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize, specta::Type)]
@@ -60,14 +60,14 @@ impl ToolColorOptions {
pub fn apply_fill(&self, layer: LayerNodeIdentifier, responses: &mut VecDeque<Message>) { pub fn apply_fill(&self, layer: LayerNodeIdentifier, responses: &mut VecDeque<Message>) {
if let Some(color) = self.active_color() { if let Some(color) = self.active_color() {
let fill = graphene_core::vector::style::Fill::solid(color.to_gamma_srgb()); let fill = graphene_std::vector::style::Fill::solid(color.to_gamma_srgb());
responses.add(GraphOperationMessage::FillSet { layer, fill }); responses.add(GraphOperationMessage::FillSet { layer, fill });
} }
} }
pub fn apply_stroke(&self, weight: f64, layer: LayerNodeIdentifier, responses: &mut VecDeque<Message>) { pub fn apply_stroke(&self, weight: f64, layer: LayerNodeIdentifier, responses: &mut VecDeque<Message>) {
if let Some(color) = self.active_color() { if let Some(color) = self.active_color() {
let stroke = graphene_core::vector::style::Stroke::new(Some(color.to_gamma_srgb()), weight); let stroke = graphene_std::vector::style::Stroke::new(Some(color.to_gamma_srgb()), weight);
responses.add(GraphOperationMessage::StrokeSet { layer, stroke }); responses.add(GraphOperationMessage::StrokeSet { layer, stroke });
} }
} }
@@ -8,12 +8,12 @@ use glam::DVec2;
use graph_craft::concrete; use graph_craft::concrete;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::Color; use graphene_std::Color;
use graphene_core::raster::BlendMode;
use graphene_core::raster_types::{CPU, GPU, RasterDataTable};
use graphene_core::text::{Font, TypesettingConfig};
use graphene_core::vector::style::Gradient;
use graphene_std::NodeInputDecleration; use graphene_std::NodeInputDecleration;
use graphene_std::raster::BlendMode;
use graphene_std::raster_types::{CPU, GPU, RasterDataTable};
use graphene_std::text::{Font, TypesettingConfig};
use graphene_std::vector::style::Gradient;
use graphene_std::vector::{ManipulatorPointId, PointId, SegmentId, VectorModificationType}; use graphene_std::vector::{ManipulatorPointId, PointId, SegmentId, VectorModificationType};
use std::collections::VecDeque; use std::collections::VecDeque;
@@ -12,8 +12,8 @@ use crate::messages::tool::common_functionality::utility_functions::is_visible_p
use crate::messages::tool::tool_messages::path_tool::{PathOverlayMode, PointSelectState}; use crate::messages::tool::tool_messages::path_tool::{PathOverlayMode, PointSelectState};
use bezier_rs::{Bezier, BezierHandles, Subpath, TValue}; use bezier_rs::{Bezier, BezierHandles, Subpath, TValue};
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graphene_core::vector::{ManipulatorPointId, PointId, VectorData, VectorModificationType};
use graphene_std::vector::{HandleId, SegmentId}; use graphene_std::vector::{HandleId, SegmentId};
use graphene_std::vector::{ManipulatorPointId, PointId, VectorData, VectorModificationType};
#[derive(Debug, Copy, Clone, PartialEq, Eq)] #[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum SelectionChange { pub enum SelectionChange {
@@ -13,10 +13,10 @@ pub use alignment_snapper::*;
use bezier_rs::TValue; use bezier_rs::TValue;
pub use distribution_snapper::*; pub use distribution_snapper::*;
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::vector::PointId;
use graphene_std::renderer::Rect; use graphene_std::renderer::Rect;
use graphene_std::vector::NoHashBuilder; use graphene_std::vector::NoHashBuilder;
use graphene_std::vector::PointId;
pub use grid_snapper::*; pub use grid_snapper::*;
pub use layer_snapper::*; pub use layer_snapper::*;
pub use snap_results::*; pub use snap_results::*;
@@ -1,7 +1,7 @@
use super::*; use super::*;
use crate::messages::portfolio::document::utility_types::misc::*; use crate::messages::portfolio::document::utility_types::misc::*;
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
pub struct AlignmentSnapper { pub struct AlignmentSnapper {
@@ -2,7 +2,7 @@ use super::*;
use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier; use crate::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier;
use crate::messages::portfolio::document::utility_types::misc::*; use crate::messages::portfolio::document::utility_types::misc::*;
use glam::DVec2; use glam::DVec2;
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use std::collections::VecDeque; use std::collections::VecDeque;
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
@@ -1,7 +1,7 @@
use super::*; use super::*;
use crate::messages::portfolio::document::utility_types::misc::{GridSnapTarget, GridSnapping, GridType, SnapTarget}; use crate::messages::portfolio::document::utility_types::misc::{GridSnapTarget, GridSnapping, GridType, SnapTarget};
use glam::DVec2; use glam::DVec2;
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
struct Line { struct Line {
pub point: DVec2, pub point: DVec2,
@@ -5,8 +5,8 @@ use crate::messages::portfolio::document::utility_types::misc::*;
use crate::messages::prelude::*; use crate::messages::prelude::*;
use bezier_rs::{Bezier, Identifier, Subpath, TValue}; use bezier_rs::{Bezier, Identifier, Subpath, TValue};
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::vector::PointId; use graphene_std::vector::PointId;
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
pub struct LayerSnapper { pub struct LayerSnapper {
@@ -4,9 +4,9 @@ use crate::messages::portfolio::document::utility_types::misc::{DistributionSnap
use crate::messages::tool::common_functionality::snapping::SnapCandidatePoint; use crate::messages::tool::common_functionality::snapping::SnapCandidatePoint;
use bezier_rs::Bezier; use bezier_rs::Bezier;
use glam::DVec2; use glam::DVec2;
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::vector::PointId;
use graphene_std::renderer::Rect; use graphene_std::renderer::Rect;
use graphene_std::vector::PointId;
use std::collections::VecDeque; use std::collections::VecDeque;
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
@@ -11,7 +11,7 @@ use crate::messages::prelude::*;
use crate::messages::tool::common_functionality::compass_rose::Axis; use crate::messages::tool::common_functionality::compass_rose::Axis;
use crate::messages::tool::common_functionality::snapping::SnapTypeConfiguration; use crate::messages::tool::common_functionality::snapping::SnapTypeConfiguration;
use glam::{DAffine2, DMat2, DVec2}; use glam::{DAffine2, DMat2, DVec2};
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_std::renderer::Rect; use graphene_std::renderer::Rect;
/// (top, bottom, left, right) /// (top, bottom, left, right)
@@ -4,8 +4,8 @@ use crate::messages::tool::common_functionality::graph_modification_utils::get_t
use crate::messages::tool::tool_messages::path_tool::PathOverlayMode; use crate::messages::tool::tool_messages::path_tool::PathOverlayMode;
use bezier_rs::Bezier; use bezier_rs::Bezier;
use glam::DVec2; use glam::DVec2;
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::text::{FontCache, load_face}; use graphene_std::text::{FontCache, load_face};
use graphene_std::vector::{HandleId, ManipulatorPointId, PointId, SegmentId, VectorData, VectorModificationType}; use graphene_std::vector::{HandleId, ManipulatorPointId, PointId, SegmentId, VectorData, VectorModificationType};
/// Determines if a path should be extended. Goal in viewport space. Returns the path and if it is extending from the start, if applicable. /// Determines if a path should be extended. Goal in viewport space. Returns the path and if it is extending from the start, if applicable.
@@ -64,7 +64,7 @@ pub fn text_bounding_box(layer: LayerNodeIdentifier, document: &DocumentMessageH
}; };
let buzz_face = font_cache.get(font).map(|data| load_face(data)); let buzz_face = font_cache.get(font).map(|data| load_face(data));
let far = graphene_core::text::bounding_box(text, buzz_face.as_ref(), typesetting, false); let far = graphene_std::text::bounding_box(text, buzz_face.as_ref(), typesetting, false);
Quad::from_box([DVec2::ZERO, far]) Quad::from_box([DVec2::ZERO, far])
} }
+1 -1
View File
@@ -1,7 +1,7 @@
use super::utility_types::ToolType; use super::utility_types::ToolType;
use crate::messages::preferences::SelectionMode; use crate::messages::preferences::SelectionMode;
use crate::messages::prelude::*; use crate::messages::prelude::*;
use graphene_core::raster::color::Color; use graphene_std::raster::color::Color;
#[impl_message(Message, Tool)] #[impl_message(Message, Tool)]
#[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)] #[derive(PartialEq, Clone, Debug, serde::Serialize, serde::Deserialize)]
@@ -7,7 +7,7 @@ use crate::messages::portfolio::utility_types::PersistentData;
use crate::messages::prelude::*; use crate::messages::prelude::*;
use crate::messages::tool::utility_types::ToolType; use crate::messages::tool::utility_types::ToolType;
use crate::node_graph_executor::NodeGraphExecutor; use crate::node_graph_executor::NodeGraphExecutor;
use graphene_core::raster::color::Color; use graphene_std::raster::color::Color;
const ARTBOARD_OVERLAY_PROVIDER: OverlayProvider = |context| DocumentMessage::DrawArtboardOverlays(context).into(); const ARTBOARD_OVERLAY_PROVIDER: OverlayProvider = |context| DocumentMessage::DrawArtboardOverlays(context).into();
@@ -11,7 +11,7 @@ use crate::messages::tool::common_functionality::snapping::SnapData;
use crate::messages::tool::common_functionality::snapping::SnapManager; use crate::messages::tool::common_functionality::snapping::SnapManager;
use crate::messages::tool::common_functionality::transformation_cage::*; use crate::messages::tool::common_functionality::transformation_cage::*;
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
#[derive(Default)] #[derive(Default)]
pub struct ArtboardTool { pub struct ArtboardTool {
@@ -335,12 +335,12 @@ impl Fsm for ArtboardToolFsmState {
responses.add(GraphOperationMessage::NewArtboard { responses.add(GraphOperationMessage::NewArtboard {
id, id,
artboard: graphene_core::Artboard { artboard: graphene_std::Artboard {
graphic_group: graphene_core::GraphicGroupTable::default(), graphic_group: graphene_std::GraphicGroupTable::default(),
label: String::from("Artboard"), label: String::from("Artboard"),
location: start.min(end).round().as_ivec2(), location: start.min(end).round().as_ivec2(),
dimensions: (start.round() - end.round()).abs().as_ivec2(), dimensions: (start.round() - end.round()).abs().as_ivec2(),
background: graphene_core::Color::WHITE, background: graphene_std::Color::WHITE,
clip: false, clip: false,
}, },
}) })
@@ -562,12 +562,12 @@ impl Fsm for ArtboardToolFsmState {
mod test_artboard { mod test_artboard {
pub use crate::test_utils::test_prelude::*; pub use crate::test_utils::test_prelude::*;
async fn get_artboards(editor: &mut EditorTestUtils) -> Vec<graphene_core::Artboard> { async fn get_artboards(editor: &mut EditorTestUtils) -> Vec<graphene_std::Artboard> {
let instrumented = match editor.eval_graph().await { let instrumented = match editor.eval_graph().await {
Ok(instrumented) => instrumented, Ok(instrumented) => instrumented,
Err(e) => panic!("Failed to evaluate graph: {}", e), Err(e) => panic!("Failed to evaluate graph: {}", e),
}; };
instrumented.grab_all_input::<graphene_core::append_artboard::ArtboardInput>(&editor.runtime).collect() instrumented.grab_all_input::<graphene_std::append_artboard::ArtboardInput>(&editor.runtime).collect()
} }
#[tokio::test] #[tokio::test]
@@ -7,9 +7,9 @@ use crate::messages::portfolio::document::utility_types::network_interface::Flow
use crate::messages::tool::common_functionality::color_selector::{ToolColorOptions, ToolColorType}; use crate::messages::tool::common_functionality::color_selector::{ToolColorOptions, ToolColorType};
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graphene_core::Color; use graphene_std::Color;
use graphene_core::raster::BlendMode; use graphene_std::raster::BlendMode;
use graphene_core::vector::brush_stroke::{BrushInputSample, BrushStroke, BrushStyle}; use graphene_std::vector::brush_stroke::{BrushInputSample, BrushStroke, BrushStyle};
const BRUSH_MAX_SIZE: f64 = 5000.; const BRUSH_MAX_SIZE: f64 = 5000.;
@@ -11,7 +11,7 @@ use crate::messages::tool::common_functionality::resize::Resize;
use crate::messages::tool::common_functionality::snapping::SnapData; use crate::messages::tool::common_functionality::snapping::SnapData;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::Color; use graphene_std::Color;
#[derive(Default)] #[derive(Default)]
pub struct EllipseTool { pub struct EllipseTool {
@@ -320,7 +320,7 @@ impl Fsm for EllipseToolFsmState {
mod test_ellipse { mod test_ellipse {
pub use crate::test_utils::test_prelude::*; pub use crate::test_utils::test_prelude::*;
use glam::DAffine2; use glam::DAffine2;
use graphene_core::vector::generator_nodes::ellipse; use graphene_std::vector::generator_nodes::ellipse;
#[derive(Debug, PartialEq)] #[derive(Debug, PartialEq)]
struct ResolvedEllipse { struct ResolvedEllipse {
@@ -1,7 +1,7 @@
use super::tool_prelude::*; use super::tool_prelude::*;
use crate::messages::portfolio::document::overlays::utility_types::OverlayContext; use crate::messages::portfolio::document::overlays::utility_types::OverlayContext;
use crate::messages::tool::common_functionality::graph_modification_utils::NodeGraphLayer; use crate::messages::tool::common_functionality::graph_modification_utils::NodeGraphLayer;
use graphene_core::vector::style::Fill; use graphene_std::vector::style::Fill;
#[derive(Default)] #[derive(Default)]
pub struct FillTool { pub struct FillTool {
@@ -157,7 +157,7 @@ impl Fsm for FillToolFsmState {
#[cfg(test)] #[cfg(test)]
mod test_fill { mod test_fill {
pub use crate::test_utils::test_prelude::*; pub use crate::test_utils::test_prelude::*;
use graphene_core::vector::fill; use graphene_std::vector::fill;
use graphene_std::vector::style::Fill; use graphene_std::vector::style::Fill;
async fn get_fills(editor: &mut EditorTestUtils) -> Vec<Fill> { async fn get_fills(editor: &mut EditorTestUtils) -> Vec<Fill> {
@@ -9,8 +9,8 @@ use crate::messages::tool::common_functionality::graph_modification_utils;
use crate::messages::tool::common_functionality::utility_functions::should_extend; use crate::messages::tool::common_functionality::utility_functions::should_extend;
use glam::DVec2; use glam::DVec2;
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graphene_core::Color; use graphene_std::Color;
use graphene_core::vector::VectorModificationType; use graphene_std::vector::VectorModificationType;
use graphene_std::vector::{PointId, SegmentId}; use graphene_std::vector::{PointId, SegmentId};
#[derive(Default)] #[derive(Default)]
@@ -349,7 +349,7 @@ mod test_freehand {
use crate::messages::tool::tool_messages::freehand_tool::FreehandOptionsUpdate; use crate::messages::tool::tool_messages::freehand_tool::FreehandOptionsUpdate;
use crate::test_utils::test_prelude::*; use crate::test_utils::test_prelude::*;
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graphene_core::vector::VectorData; use graphene_std::vector::VectorData;
async fn get_vector_data(editor: &mut EditorTestUtils) -> Vec<(VectorData, DAffine2)> { async fn get_vector_data(editor: &mut EditorTestUtils) -> Vec<(VectorData, DAffine2)> {
let document = editor.active_document(); let document = editor.active_document();
@@ -5,7 +5,7 @@ use crate::messages::portfolio::document::utility_types::document_metadata::Laye
use crate::messages::tool::common_functionality::auto_panning::AutoPanning; use crate::messages::tool::common_functionality::auto_panning::AutoPanning;
use crate::messages::tool::common_functionality::graph_modification_utils::{NodeGraphLayer, get_gradient}; use crate::messages::tool::common_functionality::graph_modification_utils::{NodeGraphLayer, get_gradient};
use crate::messages::tool::common_functionality::snapping::SnapManager; use crate::messages::tool::common_functionality::snapping::SnapManager;
use graphene_core::vector::style::{Fill, Gradient, GradientType}; use graphene_std::vector::style::{Fill, Gradient, GradientType};
#[derive(Default)] #[derive(Default)]
pub struct GradientTool { pub struct GradientTool {
@@ -538,9 +538,9 @@ mod test_gradient {
use crate::messages::portfolio::document::{graph_operation::utility_types::TransformIn, utility_types::misc::GroupFolderType}; use crate::messages::portfolio::document::{graph_operation::utility_types::TransformIn, utility_types::misc::GroupFolderType};
pub use crate::test_utils::test_prelude::*; pub use crate::test_utils::test_prelude::*;
use glam::DAffine2; use glam::DAffine2;
use graphene_core::vector::fill; use graphene_std::vector::fill;
use graphene_core::vector::style::Gradient;
use graphene_std::vector::style::Fill; use graphene_std::vector::style::Fill;
use graphene_std::vector::style::Gradient;
use super::gradient_space_transform; use super::gradient_space_transform;
@@ -10,7 +10,7 @@ use crate::messages::tool::common_functionality::graph_modification_utils::{self
use crate::messages::tool::common_functionality::snapping::{SnapCandidatePoint, SnapConstraint, SnapData, SnapManager, SnapTypeConfiguration}; use crate::messages::tool::common_functionality::snapping::{SnapCandidatePoint, SnapConstraint, SnapData, SnapManager, SnapTypeConfiguration};
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::Color; use graphene_std::Color;
#[derive(Default)] #[derive(Default)]
pub struct LineTool { pub struct LineTool {
@@ -17,9 +17,9 @@ use crate::messages::tool::common_functionality::shape_editor::{
use crate::messages::tool::common_functionality::snapping::{SnapCache, SnapCandidatePoint, SnapConstraint, SnapData, SnapManager}; use crate::messages::tool::common_functionality::snapping::{SnapCache, SnapCandidatePoint, SnapConstraint, SnapData, SnapManager};
use crate::messages::tool::common_functionality::utility_functions::{calculate_segment_angle, find_two_param_best_approximate}; use crate::messages::tool::common_functionality::utility_functions::{calculate_segment_angle, find_two_param_best_approximate};
use bezier_rs::{Bezier, TValue}; use bezier_rs::{Bezier, TValue};
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::vector::{ManipulatorPointId, PointId, VectorModificationType};
use graphene_std::vector::{HandleId, NoHashBuilder, SegmentId, VectorData}; use graphene_std::vector::{HandleId, NoHashBuilder, SegmentId, VectorData};
use graphene_std::vector::{ManipulatorPointId, PointId, VectorModificationType};
use std::vec; use std::vec;
#[derive(Default)] #[derive(Default)]
@@ -13,9 +13,9 @@ use crate::messages::tool::common_functionality::snapping::{SnapCache, SnapCandi
use crate::messages::tool::common_functionality::utility_functions::{calculate_segment_angle, closest_point, should_extend}; use crate::messages::tool::common_functionality::utility_functions::{calculate_segment_angle, closest_point, should_extend};
use bezier_rs::{Bezier, BezierHandles}; use bezier_rs::{Bezier, BezierHandles};
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graphene_core::Color; use graphene_std::Color;
use graphene_core::vector::{PointId, VectorModificationType};
use graphene_std::vector::{HandleId, ManipulatorPointId, NoHashBuilder, SegmentId, StrokeId, VectorData}; use graphene_std::vector::{HandleId, ManipulatorPointId, NoHashBuilder, SegmentId, StrokeId, VectorData};
use graphene_std::vector::{PointId, VectorModificationType};
#[derive(Default)] #[derive(Default)]
pub struct PenTool { pub struct PenTool {
@@ -12,7 +12,7 @@ use crate::messages::tool::common_functionality::resize::Resize;
use crate::messages::tool::common_functionality::snapping::SnapData; use crate::messages::tool::common_functionality::snapping::SnapData;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::Color; use graphene_std::Color;
#[derive(Default)] #[derive(Default)]
pub struct PolygonTool { pub struct PolygonTool {
@@ -11,7 +11,7 @@ use crate::messages::tool::common_functionality::resize::Resize;
use crate::messages::tool::common_functionality::snapping::SnapData; use crate::messages::tool::common_functionality::snapping::SnapData;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::Color; use graphene_std::Color;
#[derive(Default)] #[derive(Default)]
pub struct RectangleTool { pub struct RectangleTool {
@@ -26,7 +26,7 @@ use crate::messages::tool::common_functionality::utility_functions::text_boundin
use bezier_rs::Subpath; use bezier_rs::Subpath;
use glam::DMat2; use glam::DMat2;
use graph_craft::document::NodeId; use graph_craft::document::NodeId;
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_std::renderer::Rect; use graphene_std::renderer::Rect;
use graphene_std::transform::ReferencePoint; use graphene_std::transform::ReferencePoint;
use graphene_std::vector::misc::BooleanOperation; use graphene_std::vector::misc::BooleanOperation;
@@ -181,7 +181,7 @@ impl SelectTool {
} }
fn boolean_widgets(&self, selected_count: usize) -> impl Iterator<Item = WidgetHolder> + use<> { fn boolean_widgets(&self, selected_count: usize) -> impl Iterator<Item = WidgetHolder> + use<> {
let list = <BooleanOperation as graphene_core::registry::ChoiceTypeStatic>::list(); let list = <BooleanOperation as graphene_std::registry::ChoiceTypeStatic>::list();
list.into_iter().map(|i| i.into_iter()).flatten().map(move |(operation, info)| { list.into_iter().map(|i| i.into_iter()).flatten().map(move |(operation, info)| {
let mut tooltip = info.label.to_string(); let mut tooltip = info.label.to_string();
if let Some(doc) = info.docstring.as_deref() { if let Some(doc) = info.docstring.as_deref() {
@@ -563,7 +563,7 @@ impl Fsm for SelectToolFsmState {
.metadata() .metadata()
.bounding_box_with_transform(layer, transform.inverse() * document.metadata().transform_to_viewport(layer)) .bounding_box_with_transform(layer, transform.inverse() * document.metadata().transform_to_viewport(layer))
}) })
.reduce(graphene_core::renderer::Quad::combine_bounds); .reduce(graphene_std::renderer::Quad::combine_bounds);
// When not in Drawing State // When not in Drawing State
// Only highlight layers if the viewport is not being panned (middle mouse button is pressed) // Only highlight layers if the viewport is not being panned (middle mouse button is pressed)
@@ -11,7 +11,7 @@ use crate::messages::tool::common_functionality::graph_modification_utils::{self
use crate::messages::tool::common_functionality::snapping::{SnapCandidatePoint, SnapData, SnapManager, SnapTypeConfiguration, SnappedPoint}; use crate::messages::tool::common_functionality::snapping::{SnapCandidatePoint, SnapData, SnapManager, SnapTypeConfiguration, SnappedPoint};
use crate::messages::tool::common_functionality::utility_functions::{closest_point, should_extend}; use crate::messages::tool::common_functionality::utility_functions::{closest_point, should_extend};
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::Color; use graphene_std::Color;
use graphene_std::vector::{PointId, SegmentId, VectorModificationType}; use graphene_std::vector::{PointId, SegmentId, VectorModificationType};
#[derive(Default)] #[derive(Default)]
@@ -541,8 +541,8 @@ mod test_spline_tool {
use crate::messages::tool::tool_messages::spline_tool::find_spline; use crate::messages::tool::tool_messages::spline_tool::find_spline;
use crate::test_utils::test_prelude::*; use crate::test_utils::test_prelude::*;
use glam::DAffine2; use glam::DAffine2;
use graphene_core::vector::VectorData;
use graphene_std::vector::PointId; use graphene_std::vector::PointId;
use graphene_std::vector::VectorData;
fn assert_point_positions(vector_data: &VectorData, layer_to_viewport: DAffine2, expected_points: &[DVec2], epsilon: f64) { fn assert_point_positions(vector_data: &VectorData, layer_to_viewport: DAffine2, expected_points: &[DVec2], epsilon: f64) {
let points_in_viewport: Vec<DVec2> = vector_data let points_in_viewport: Vec<DVec2> = vector_data
@@ -16,10 +16,10 @@ use crate::messages::tool::common_functionality::transformation_cage::*;
use crate::messages::tool::common_functionality::utility_functions::text_bounding_box; use crate::messages::tool::common_functionality::utility_functions::text_bounding_box;
use graph_craft::document::value::TaggedValue; use graph_craft::document::value::TaggedValue;
use graph_craft::document::{NodeId, NodeInput}; use graph_craft::document::{NodeId, NodeInput};
use graphene_core::Color; use graphene_std::Color;
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::text::{Font, FontCache, TypesettingConfig, lines_clipping, load_face}; use graphene_std::text::{Font, FontCache, TypesettingConfig, lines_clipping, load_face};
use graphene_core::vector::style::Fill; use graphene_std::vector::style::Fill;
#[derive(Default)] #[derive(Default)]
pub struct TextTool { pub struct TextTool {
@@ -43,8 +43,8 @@ impl Default for TextOptions {
font_size: 24., font_size: 24.,
line_height_ratio: 1.2, line_height_ratio: 1.2,
character_spacing: 1., character_spacing: 1.,
font_name: graphene_core::consts::DEFAULT_FONT_FAMILY.into(), font_name: graphene_std::consts::DEFAULT_FONT_FAMILY.into(),
font_style: graphene_core::consts::DEFAULT_FONT_STYLE.into(), font_style: graphene_std::consts::DEFAULT_FONT_STYLE.into(),
fill: ToolColorOptions::new_primary(), fill: ToolColorOptions::new_primary(),
} }
} }
@@ -469,7 +469,7 @@ impl Fsm for TextToolFsmState {
}); });
if let Some(editing_text) = tool_data.editing_text.as_mut() { if let Some(editing_text) = tool_data.editing_text.as_mut() {
let buzz_face = font_cache.get(&editing_text.font).map(|data| load_face(data)); let buzz_face = font_cache.get(&editing_text.font).map(|data| load_face(data));
let far = graphene_core::text::bounding_box(&tool_data.new_text, buzz_face.as_ref(), editing_text.typesetting, false); let far = graphene_std::text::bounding_box(&tool_data.new_text, buzz_face.as_ref(), editing_text.typesetting, false);
if far.x != 0. && far.y != 0. { if far.x != 0. && far.y != 0. {
let quad = Quad::from_box([DVec2::ZERO, far]); let quad = Quad::from_box([DVec2::ZERO, far]);
let transformed_quad = document.metadata().transform_to_viewport(tool_data.layer) * quad; let transformed_quad = document.metadata().transform_to_viewport(tool_data.layer) * quad;
@@ -9,8 +9,8 @@ use crate::messages::tool::common_functionality::shape_editor::ShapeState;
use crate::messages::tool::tool_messages::tool_prelude::Key; use crate::messages::tool::tool_messages::tool_prelude::Key;
use crate::messages::tool::utility_types::{ToolData, ToolType}; use crate::messages::tool::utility_types::{ToolData, ToolType};
use glam::{DAffine2, DVec2}; use glam::{DAffine2, DVec2};
use graphene_core::renderer::Quad; use graphene_std::renderer::Quad;
use graphene_core::vector::ManipulatorPointId; use graphene_std::vector::ManipulatorPointId;
use graphene_std::vector::{VectorData, VectorModificationType}; use graphene_std::vector::{VectorData, VectorModificationType};
use std::f64::consts::{PI, TAU}; use std::f64::consts::{PI, TAU};
@@ -721,7 +721,7 @@ mod test_transform_layer {
use crate::messages::tool::transform_layer::transform_layer_message_handler::VectorModificationType; use crate::messages::tool::transform_layer::transform_layer_message_handler::VectorModificationType;
use crate::test_utils::test_prelude::*; use crate::test_utils::test_prelude::*;
use glam::DAffine2; use glam::DAffine2;
use graphene_core::vector::PointId; use graphene_std::vector::PointId;
use std::collections::VecDeque; use std::collections::VecDeque;
async fn get_layer_transform(editor: &mut EditorTestUtils, layer: LayerNodeIdentifier) -> Option<DAffine2> { async fn get_layer_transform(editor: &mut EditorTestUtils, layer: LayerNodeIdentifier) -> Option<DAffine2> {
+2 -2
View File
@@ -12,8 +12,8 @@ use crate::messages::portfolio::document::overlays::utility_types::OverlayProvid
use crate::messages::preferences::PreferencesMessageHandler; use crate::messages::preferences::PreferencesMessageHandler;
use crate::messages::prelude::*; use crate::messages::prelude::*;
use crate::node_graph_executor::NodeGraphExecutor; use crate::node_graph_executor::NodeGraphExecutor;
use graphene_core::raster::color::Color; use graphene_std::raster::color::Color;
use graphene_core::text::FontCache; use graphene_std::text::FontCache;
use std::borrow::Cow; use std::borrow::Cow;
use std::fmt::{self, Debug}; use std::fmt::{self, Debug};
+9 -9
View File
@@ -6,15 +6,15 @@ use graph_craft::document::value::{RenderOutput, TaggedValue};
use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput, generate_uuid}; use graph_craft::document::{DocumentNode, DocumentNodeImplementation, NodeId, NodeInput, generate_uuid};
use graph_craft::proto::GraphErrors; use graph_craft::proto::GraphErrors;
use graph_craft::wasm_application_io::EditorPreferences; use graph_craft::wasm_application_io::EditorPreferences;
use graphene_core::application_io::{NodeGraphUpdateMessage, RenderConfig};
use graphene_core::renderer::RenderSvgSegmentList;
use graphene_core::renderer::{GraphicElementRendered, RenderParams, SvgRender};
use graphene_core::text::FontCache;
use graphene_core::transform::Footprint;
use graphene_core::vector::style::ViewMode;
use graphene_std::application_io::TimingInformation; use graphene_std::application_io::TimingInformation;
use graphene_std::application_io::{NodeGraphUpdateMessage, RenderConfig};
use graphene_std::renderer::RenderSvgSegmentList;
use graphene_std::renderer::{GraphicElementRendered, RenderParams, SvgRender};
use graphene_std::renderer::{RenderMetadata, format_transform_matrix}; use graphene_std::renderer::{RenderMetadata, format_transform_matrix};
use graphene_std::text::FontCache;
use graphene_std::transform::Footprint;
use graphene_std::vector::VectorData; use graphene_std::vector::VectorData;
use graphene_std::vector::style::ViewMode;
use interpreted_executor::dynamic_executor::ResolvedDocumentNodeTypesDelta; use interpreted_executor::dynamic_executor::ResolvedDocumentNodeTypesDelta;
mod runtime_io; mod runtime_io;
@@ -152,9 +152,9 @@ impl NodeGraphExecutor {
}, },
time, time,
#[cfg(any(feature = "resvg", feature = "vello"))] #[cfg(any(feature = "resvg", feature = "vello"))]
export_format: graphene_core::application_io::ExportFormat::Canvas, export_format: graphene_std::application_io::ExportFormat::Canvas,
#[cfg(not(any(feature = "resvg", feature = "vello")))] #[cfg(not(any(feature = "resvg", feature = "vello")))]
export_format: graphene_core::application_io::ExportFormat::Svg, export_format: graphene_std::application_io::ExportFormat::Svg,
view_mode: document.view_mode, view_mode: document.view_mode,
hide_artboards: false, hide_artboards: false,
for_export: false, for_export: false,
@@ -204,7 +204,7 @@ impl NodeGraphExecutor {
..Default::default() ..Default::default()
}, },
time: Default::default(), time: Default::default(),
export_format: graphene_core::application_io::ExportFormat::Svg, export_format: graphene_std::application_io::ExportFormat::Svg,
view_mode: document.view_mode, view_mode: document.view_mode,
hide_artboards: export_config.transparent_background, hide_artboards: export_config.transparent_background,
for_export: true, for_export: true,
+8 -8
View File
@@ -7,14 +7,14 @@ use graph_craft::document::{NodeId, NodeNetwork};
use graph_craft::graphene_compiler::Compiler; use graph_craft::graphene_compiler::Compiler;
use graph_craft::proto::GraphErrors; use graph_craft::proto::GraphErrors;
use graph_craft::wasm_application_io::EditorPreferences; use graph_craft::wasm_application_io::EditorPreferences;
use graphene_core::application_io::{NodeGraphUpdateMessage, NodeGraphUpdateSender, RenderConfig};
use graphene_core::memo::IORecord;
use graphene_core::renderer::{GraphicElementRendered, RenderParams, SvgRender};
use graphene_core::renderer::{RenderSvgSegmentList, SvgSegment};
use graphene_core::text::FontCache;
use graphene_core::vector::style::ViewMode;
use graphene_std::Context; use graphene_std::Context;
use graphene_std::application_io::{NodeGraphUpdateMessage, NodeGraphUpdateSender, RenderConfig};
use graphene_std::instances::Instance; use graphene_std::instances::Instance;
use graphene_std::memo::IORecord;
use graphene_std::renderer::{GraphicElementRendered, RenderParams, SvgRender};
use graphene_std::renderer::{RenderSvgSegmentList, SvgSegment};
use graphene_std::text::FontCache;
use graphene_std::vector::style::ViewMode;
use graphene_std::vector::{VectorData, VectorDataTable}; use graphene_std::vector::{VectorData, VectorDataTable};
use graphene_std::wasm_application_io::{WasmApplicationIo, WasmEditorApi}; use graphene_std::wasm_application_io::{WasmApplicationIo, WasmEditorApi};
use interpreted_executor::dynamic_executor::{DynamicExecutor, IntrospectError, ResolvedDocumentNodeTypesDelta}; use interpreted_executor::dynamic_executor::{DynamicExecutor, IntrospectError, ResolvedDocumentNodeTypesDelta};
@@ -288,9 +288,9 @@ impl NodeRuntime {
continue; continue;
}; };
if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, graphene_core::GraphicElement>>() { if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, graphene_std::GraphicElement>>() {
Self::process_graphic_element(&mut self.thumbnail_renders, parent_network_node_id, &io.output, responses, update_thumbnails) Self::process_graphic_element(&mut self.thumbnail_renders, parent_network_node_id, &io.output, responses, update_thumbnails)
} else if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, graphene_core::Artboard>>() { } else if let Some(io) = introspected_data.downcast_ref::<IORecord<Context, graphene_std::Artboard>>() {
Self::process_graphic_element(&mut self.thumbnail_renders, parent_network_node_id, &io.output, responses, update_thumbnails) Self::process_graphic_element(&mut self.thumbnail_renders, parent_network_node_id, &io.output, responses, update_thumbnails)
// Insert the vector modify if we are dealing with vector data // Insert the vector modify if we are dealing with vector data
} else if let Some(record) = introspected_data.downcast_ref::<IORecord<Context, VectorDataTable>>() { } else if let Some(record) = introspected_data.downcast_ref::<IORecord<Context, VectorDataTable>>() {
+5 -5
View File
@@ -11,8 +11,8 @@ use crate::node_graph_executor::NodeRuntime;
use crate::test_utils::test_prelude::LayerNodeIdentifier; use crate::test_utils::test_prelude::LayerNodeIdentifier;
use glam::DVec2; use glam::DVec2;
use graph_craft::document::DocumentNode; use graph_craft::document::DocumentNode;
use graphene_core::InputAccessor; use graphene_std::InputAccessor;
use graphene_core::raster::color::Color; use graphene_std::raster::color::Color;
/// A set of utility functions to make the writing of editor test more declarative /// A set of utility functions to make the writing of editor test more declarative
pub struct EditorTestUtils { pub struct EditorTestUtils {
@@ -229,7 +229,7 @@ impl EditorTestUtils {
self.handle_message(Message::Tool(ToolMessage::SelectSecondaryColor { color })).await; self.handle_message(Message::Tool(ToolMessage::SelectSecondaryColor { color })).await;
} }
pub async fn create_raster_image(&mut self, image: graphene_core::raster::Image<Color>, mouse: Option<(f64, f64)>) { pub async fn create_raster_image(&mut self, image: graphene_std::raster::Image<Color>, mouse: Option<(f64, f64)>) {
self.handle_message(PortfolioMessage::PasteImage { self.handle_message(PortfolioMessage::PasteImage {
name: None, name: None,
image, image,
@@ -323,9 +323,9 @@ pub mod test_prelude {
pub use glam::DVec2; pub use glam::DVec2;
pub use glam::IVec2; pub use glam::IVec2;
pub use graph_craft::document::DocumentNode; pub use graph_craft::document::DocumentNode;
pub use graphene_core::raster::{Color, Image}; pub use graphene_std::raster::{Color, Image};
pub use graphene_core::{InputAccessor, InputAccessorSource};
pub use graphene_std::transform::Footprint; pub use graphene_std::transform::Footprint;
pub use graphene_std::{InputAccessor, InputAccessorSource};
#[macro_export] #[macro_export]
macro_rules! float_eq { macro_rules! float_eq {