mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-08-24 06:54:07 +00:00
Merge branch 'master' into fix-stroke-alignment-outside
This commit is contained in:
commit
ac93b41ad9
10 changed files with 17 additions and 40 deletions
11
Cargo.lock
generated
11
Cargo.lock
generated
|
@ -2000,7 +2000,6 @@ dependencies = [
|
||||||
"dyn-any",
|
"dyn-any",
|
||||||
"glam",
|
"glam",
|
||||||
"graphene-core",
|
"graphene-core",
|
||||||
"kurbo",
|
|
||||||
"log",
|
"log",
|
||||||
"node-macro",
|
"node-macro",
|
||||||
"path-bool",
|
"path-bool",
|
||||||
|
@ -2035,10 +2034,7 @@ name = "graphene-std"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"bytemuck",
|
|
||||||
"dyn-any",
|
"dyn-any",
|
||||||
"fastnoise-lite",
|
|
||||||
"futures",
|
|
||||||
"glam",
|
"glam",
|
||||||
"graph-craft",
|
"graph-craft",
|
||||||
"graphene-application-io",
|
"graphene-application-io",
|
||||||
|
@ -2050,10 +2046,7 @@ dependencies = [
|
||||||
"graphene-svg-renderer",
|
"graphene-svg-renderer",
|
||||||
"image",
|
"image",
|
||||||
"log",
|
"log",
|
||||||
"ndarray",
|
|
||||||
"node-macro",
|
"node-macro",
|
||||||
"rand 0.9.1",
|
|
||||||
"rand_chacha 0.9.0",
|
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"tokio",
|
"tokio",
|
||||||
"vello",
|
"vello",
|
||||||
|
@ -2112,7 +2105,6 @@ version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"bitflags 2.9.1",
|
"bitflags 2.9.1",
|
||||||
"bytemuck",
|
|
||||||
"derivative",
|
"derivative",
|
||||||
"dyn-any",
|
"dyn-any",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
|
@ -2128,18 +2120,15 @@ dependencies = [
|
||||||
"num_enum",
|
"num_enum",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"preprocessor",
|
"preprocessor",
|
||||||
"ron",
|
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"specta",
|
"specta",
|
||||||
"spin",
|
"spin",
|
||||||
"thiserror 2.0.12",
|
"thiserror 2.0.12",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
|
||||||
"usvg",
|
"usvg",
|
||||||
"vello",
|
"vello",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"wasm-bindgen-futures",
|
|
||||||
"web-sys",
|
"web-sys",
|
||||||
"wgpu-executor",
|
"wgpu-executor",
|
||||||
]
|
]
|
||||||
|
|
|
@ -85,7 +85,6 @@ thiserror = "2"
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
proc-macro2 = { version = "1", features = ["span-locations"] }
|
proc-macro2 = { version = "1", features = ["span-locations"] }
|
||||||
quote = "1.0"
|
quote = "1.0"
|
||||||
axum = "0.8"
|
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
ron = "0.8"
|
ron = "0.8"
|
||||||
fastnoise-lite = "1.1"
|
fastnoise-lite = "1.1"
|
||||||
|
|
|
@ -12,11 +12,11 @@ license = "Apache-2.0"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["wasm"]
|
default = ["wasm"]
|
||||||
wasm = ["wasm-bindgen", "graphene-std/wasm", "wasm-bindgen-futures"]
|
wasm = ["wasm-bindgen", "graphene-std/wasm"]
|
||||||
gpu = ["interpreted-executor/gpu", "wgpu-executor"]
|
gpu = ["interpreted-executor/gpu", "wgpu-executor"]
|
||||||
resvg = ["graphene-std/resvg"]
|
resvg = ["graphene-std/resvg"]
|
||||||
vello = ["graphene-std/vello", "resvg"]
|
vello = ["graphene-std/vello", "resvg"]
|
||||||
ron = ["dep:ron"]
|
ron = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# Local dependencies
|
# Local dependencies
|
||||||
|
@ -43,9 +43,7 @@ num_enum = { workspace = true }
|
||||||
usvg = { workspace = true }
|
usvg = { workspace = true }
|
||||||
once_cell = { workspace = true }
|
once_cell = { workspace = true }
|
||||||
web-sys = { workspace = true }
|
web-sys = { workspace = true }
|
||||||
bytemuck = { workspace = true }
|
|
||||||
vello = { workspace = true }
|
vello = { workspace = true }
|
||||||
tracing = { workspace = true }
|
|
||||||
base64 = { workspace = true }
|
base64 = { workspace = true }
|
||||||
|
|
||||||
# Required dependencies
|
# Required dependencies
|
||||||
|
@ -56,8 +54,6 @@ wgpu-executor = { workspace = true, optional = true }
|
||||||
|
|
||||||
# Optional workspace dependencies
|
# Optional workspace dependencies
|
||||||
wasm-bindgen = { workspace = true, optional = true }
|
wasm-bindgen = { workspace = true, optional = true }
|
||||||
wasm-bindgen-futures = { workspace = true, optional = true }
|
|
||||||
ron = { workspace = true, optional = true }
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
# Workspace dependencies
|
# Workspace dependencies
|
||||||
|
|
|
@ -202,6 +202,7 @@ impl core::hash::Hash for OverlayContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl OverlayContext {
|
impl OverlayContext {
|
||||||
|
#[allow(dead_code)]
|
||||||
pub(super) fn new(size: DVec2, device_pixel_ratio: f64, visibility_settings: OverlaysVisibilitySettings) -> Self {
|
pub(super) fn new(size: DVec2, device_pixel_ratio: f64, visibility_settings: OverlaysVisibilitySettings) -> Self {
|
||||||
Self {
|
Self {
|
||||||
internal: Arc::new(Mutex::new(OverlayContextInternal::new(size, device_pixel_ratio, visibility_settings))),
|
internal: Arc::new(Mutex::new(OverlayContextInternal::new(size, device_pixel_ratio, visibility_settings))),
|
||||||
|
|
|
@ -33,3 +33,6 @@ graphene-core = { workspace = true }
|
||||||
unexpected_cfgs = { level = "warn", check-cfg = [
|
unexpected_cfgs = { level = "warn", check-cfg = [
|
||||||
'cfg(target_arch, values("spirv"))',
|
'cfg(target_arch, values("spirv"))',
|
||||||
] }
|
] }
|
||||||
|
|
||||||
|
[package.metadata.cargo-shear]
|
||||||
|
ignored = ["graphene-core"]
|
||||||
|
|
|
@ -10,18 +10,6 @@ pub trait Identifier: Sized + Clone + PartialEq + Hash + 'static {
|
||||||
fn new() -> Self;
|
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`
|
/// Structure used to represent a single anchor with up to two optional associated handles along a `Subpath`
|
||||||
#[derive(Copy, Clone, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||||
|
|
|
@ -371,6 +371,16 @@ impl Stroke {
|
||||||
self.weight
|
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 {
|
pub fn dash_lengths(&self) -> String {
|
||||||
if self.dash_lengths.is_empty() {
|
if self.dash_lengths.is_empty() {
|
||||||
"none".to_string()
|
"none".to_string()
|
||||||
|
|
|
@ -16,4 +16,3 @@ specta = { workspace = true }
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
path-bool = { workspace = true }
|
path-bool = { workspace = true }
|
||||||
serde = { workspace = true }
|
serde = { workspace = true }
|
||||||
kurbo = { workspace = true }
|
|
||||||
|
|
|
@ -36,15 +36,10 @@ graphene-raster-nodes = { workspace = true }
|
||||||
graphene-brush = { workspace = true }
|
graphene-brush = { workspace = true }
|
||||||
|
|
||||||
# Workspace dependencies
|
# Workspace dependencies
|
||||||
fastnoise-lite = { workspace = true }
|
|
||||||
log = { workspace = true }
|
log = { workspace = true }
|
||||||
glam = { workspace = true }
|
glam = { workspace = true }
|
||||||
node-macro = { workspace = true }
|
node-macro = { workspace = true }
|
||||||
reqwest = { workspace = true }
|
reqwest = { workspace = true }
|
||||||
futures = { workspace = true }
|
|
||||||
rand_chacha = { workspace = true }
|
|
||||||
rand = { workspace = true }
|
|
||||||
bytemuck = { workspace = true }
|
|
||||||
image = { workspace = true }
|
image = { workspace = true }
|
||||||
base64 = { workspace = true }
|
base64 = { workspace = true }
|
||||||
|
|
||||||
|
@ -65,8 +60,5 @@ web-sys = { workspace = true, optional = true, features = [
|
||||||
"ImageBitmapRenderingContext",
|
"ImageBitmapRenderingContext",
|
||||||
] }
|
] }
|
||||||
|
|
||||||
# Required dependencies
|
|
||||||
ndarray = "0.16.1"
|
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tokio = { workspace = true }
|
tokio = { workspace = true }
|
||||||
|
|
|
@ -1074,7 +1074,7 @@ impl Render for Table<Vector> {
|
||||||
let vector = row.element;
|
let vector = row.element;
|
||||||
|
|
||||||
if let Some(element_id) = element_id {
|
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 filled = vector.style.fill() != &Fill::None;
|
||||||
let fill = |mut subpath: Subpath<_>| {
|
let fill = |mut subpath: Subpath<_>| {
|
||||||
if filled {
|
if filled {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue