mirror of
https://github.com/storytold/cadcraft.git
synced 2026-12-02 02:38:30 -06:00
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).
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user