diff --git a/node-graph/gcore/src/vector/style.rs b/node-graph/gcore/src/vector/style.rs index 7b3047fc..28504012 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 baadedf4..f470e628 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 {