From d955a3ccfcc246ef54b2c82b911f601bec39cfcf Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 26 Nov 2026 05:30:04 +0100 Subject: [PATCH] Clamp gap-first open-run dashes to the start of the run In the x < 0 branch, a dash that starts slightly before p0 could push a negative range. Keep the start at p0 (and the existing end cap at p0 + len). --- crates/render/src/linetype.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/render/src/linetype.rs b/crates/render/src/linetype.rs index 95bb71896..c1c11e61e 100644 --- a/crates/render/src/linetype.rs +++ b/crates/render/src/linetype.rs @@ -130,8 +130,8 @@ fn gap_first(len: f64, pattern: &[f64], period: f64) -> Vec<(f64, f64)> { continue; } let b = b.min(p0 + len); - if b > a || (e == 0.0 && (p0..=p0 + len).contains(&a)) { - out.push((a - p0, b - p0)); + if b > a.max(p0) || (e == 0.0 && (p0..=p0 + len).contains(&a)) { + out.push((a.max(p0) - p0, b - p0)); } } }