From 0a53eae4e0cf746482ba59257d1c6698a714e991 Mon Sep 17 00:00:00 2001 From: Firestar99 Date: Mon, 18 Aug 2025 20:26:44 +0200 Subject: [PATCH 1/2] Remove unused cargo dependencies (#3063) * cargo shear * fix warnings on master * fix docs needing dev-dependency --- Cargo.lock | 11 ----------- Cargo.toml | 1 - editor/Cargo.toml | 8 ++------ .../document/overlays/utility_types_vello.rs | 1 + node-graph/gcore-shaders/Cargo.toml | 3 +++ node-graph/gcore/src/subpath/structs.rs | 12 ------------ node-graph/gpath-bool/Cargo.toml | 1 - node-graph/gstd/Cargo.toml | 8 -------- 8 files changed, 6 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ea190783..102a4fda1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2000,7 +2000,6 @@ dependencies = [ "dyn-any", "glam", "graphene-core", - "kurbo", "log", "node-macro", "path-bool", @@ -2035,10 +2034,7 @@ name = "graphene-std" version = "0.1.0" dependencies = [ "base64 0.22.1", - "bytemuck", "dyn-any", - "fastnoise-lite", - "futures", "glam", "graph-craft", "graphene-application-io", @@ -2050,10 +2046,7 @@ dependencies = [ "graphene-svg-renderer", "image", "log", - "ndarray", "node-macro", - "rand 0.9.1", - "rand_chacha 0.9.0", "reqwest", "tokio", "vello", @@ -2112,7 +2105,6 @@ version = "0.0.0" dependencies = [ "base64 0.22.1", "bitflags 2.9.1", - "bytemuck", "derivative", "dyn-any", "env_logger", @@ -2128,18 +2120,15 @@ dependencies = [ "num_enum", "once_cell", "preprocessor", - "ron", "serde", "serde_json", "specta", "spin", "thiserror 2.0.12", "tokio", - "tracing", "usvg", "vello", "wasm-bindgen", - "wasm-bindgen-futures", "web-sys", "wgpu-executor", ] diff --git a/Cargo.toml b/Cargo.toml index 88358d8e8..9ce23998b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -85,7 +85,6 @@ thiserror = "2" anyhow = "1.0" proc-macro2 = { version = "1", features = ["span-locations"] } quote = "1.0" -axum = "0.8" chrono = "0.4" ron = "0.8" fastnoise-lite = "1.1" diff --git a/editor/Cargo.toml b/editor/Cargo.toml index 1ecd99867..6b36914df 100644 --- a/editor/Cargo.toml +++ b/editor/Cargo.toml @@ -12,11 +12,11 @@ license = "Apache-2.0" [features] default = ["wasm"] -wasm = ["wasm-bindgen", "graphene-std/wasm", "wasm-bindgen-futures"] +wasm = ["wasm-bindgen", "graphene-std/wasm"] gpu = ["interpreted-executor/gpu", "wgpu-executor"] resvg = ["graphene-std/resvg"] vello = ["graphene-std/vello", "resvg"] -ron = ["dep:ron"] +ron = [] [dependencies] # Local dependencies @@ -43,9 +43,7 @@ num_enum = { workspace = true } usvg = { workspace = true } once_cell = { workspace = true } web-sys = { workspace = true } -bytemuck = { workspace = true } vello = { workspace = true } -tracing = { workspace = true } base64 = { workspace = true } # Required dependencies @@ -56,8 +54,6 @@ wgpu-executor = { workspace = true, optional = true } # Optional workspace dependencies wasm-bindgen = { workspace = true, optional = true } -wasm-bindgen-futures = { workspace = true, optional = true } -ron = { workspace = true, optional = true } [dev-dependencies] # Workspace dependencies diff --git a/editor/src/messages/portfolio/document/overlays/utility_types_vello.rs b/editor/src/messages/portfolio/document/overlays/utility_types_vello.rs index 3f31a85d4..584c64b08 100644 --- a/editor/src/messages/portfolio/document/overlays/utility_types_vello.rs +++ b/editor/src/messages/portfolio/document/overlays/utility_types_vello.rs @@ -202,6 +202,7 @@ impl core::hash::Hash for OverlayContext { } impl OverlayContext { + #[allow(dead_code)] pub(super) fn new(size: DVec2, device_pixel_ratio: f64, visibility_settings: OverlaysVisibilitySettings) -> Self { Self { internal: Arc::new(Mutex::new(OverlayContextInternal::new(size, device_pixel_ratio, visibility_settings))), diff --git a/node-graph/gcore-shaders/Cargo.toml b/node-graph/gcore-shaders/Cargo.toml index 0fefb577a..9759217f0 100644 --- a/node-graph/gcore-shaders/Cargo.toml +++ b/node-graph/gcore-shaders/Cargo.toml @@ -33,3 +33,6 @@ graphene-core = { workspace = true } unexpected_cfgs = { level = "warn", check-cfg = [ 'cfg(target_arch, values("spirv"))', ] } + +[package.metadata.cargo-shear] +ignored = ["graphene-core"] diff --git a/node-graph/gcore/src/subpath/structs.rs b/node-graph/gcore/src/subpath/structs.rs index e4d2ac21d..d5f868be2 100644 --- a/node-graph/gcore/src/subpath/structs.rs +++ b/node-graph/gcore/src/subpath/structs.rs @@ -10,18 +10,6 @@ pub trait Identifier: Sized + Clone + PartialEq + Hash + 'static { fn new() -> Self; } -/// An empty id type for use in tests -#[derive(Clone, Copy, PartialEq, Eq, Debug, Hash)] -#[cfg(test)] -pub(crate) struct EmptyId; - -#[cfg(test)] -impl Identifier for EmptyId { - fn new() -> Self { - Self - } -} - /// Structure used to represent a single anchor with up to two optional associated handles along a `Subpath` #[derive(Copy, Clone, PartialEq)] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] diff --git a/node-graph/gpath-bool/Cargo.toml b/node-graph/gpath-bool/Cargo.toml index beec63cb1..9882a75c6 100644 --- a/node-graph/gpath-bool/Cargo.toml +++ b/node-graph/gpath-bool/Cargo.toml @@ -16,4 +16,3 @@ specta = { workspace = true } log = { workspace = true } path-bool = { workspace = true } serde = { workspace = true } -kurbo = { workspace = true } diff --git a/node-graph/gstd/Cargo.toml b/node-graph/gstd/Cargo.toml index 0c20bd8f3..6eb7e8a07 100644 --- a/node-graph/gstd/Cargo.toml +++ b/node-graph/gstd/Cargo.toml @@ -36,15 +36,10 @@ graphene-raster-nodes = { workspace = true } graphene-brush = { workspace = true } # Workspace dependencies -fastnoise-lite = { workspace = true } log = { workspace = true } glam = { workspace = true } node-macro = { workspace = true } reqwest = { workspace = true } -futures = { workspace = true } -rand_chacha = { workspace = true } -rand = { workspace = true } -bytemuck = { workspace = true } image = { workspace = true } base64 = { workspace = true } @@ -65,8 +60,5 @@ web-sys = { workspace = true, optional = true, features = [ "ImageBitmapRenderingContext", ] } -# Required dependencies -ndarray = "0.16.1" - [dev-dependencies] tokio = { workspace = true } From 5ed45ead6f06d8b553578dc1b17dd5cb9f7fc680 Mon Sep 17 00:00:00 2001 From: mTvare Date: Tue, 19 Aug 2025 01:00:57 +0530 Subject: [PATCH 2/2] Fix click target not extending to correct limit for aligned strokes (#3065) Fixes #3047 --- node-graph/gcore/src/vector/style.rs | 10 ++++++++++ node-graph/gsvg-renderer/src/renderer.rs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/node-graph/gcore/src/vector/style.rs b/node-graph/gcore/src/vector/style.rs index 7b3047fc6..285040127 100644 --- a/node-graph/gcore/src/vector/style.rs +++ b/node-graph/gcore/src/vector/style.rs @@ -371,6 +371,16 @@ impl Stroke { self.weight } + /// Get the effective stroke weight. + pub fn effective_width(&self) -> f64 { + self.weight + * match self.align { + StrokeAlign::Center => 1., + StrokeAlign::Inside => 0., + StrokeAlign::Outside => 2., + } + } + pub fn dash_lengths(&self) -> String { if self.dash_lengths.is_empty() { "none".to_string() diff --git a/node-graph/gsvg-renderer/src/renderer.rs b/node-graph/gsvg-renderer/src/renderer.rs index baadedf49..f470e628e 100644 --- a/node-graph/gsvg-renderer/src/renderer.rs +++ b/node-graph/gsvg-renderer/src/renderer.rs @@ -988,7 +988,7 @@ impl Render for Table { let vector = row.element; if let Some(element_id) = element_id { - let stroke_width = vector.style.stroke().as_ref().map_or(0., Stroke::weight); + let stroke_width = vector.style.stroke().as_ref().map_or(0., Stroke::effective_width); let filled = vector.style.fill() != &Fill::None; let fill = |mut subpath: Subpath<_>| { if filled {