From 95a4419d0d92dd1ffccee2acd5004d805fff1ae5 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 1 Oct 2026 00:27:42 +0300 Subject: [PATCH] fix(blocks): each dashed line in a block starts its own pattern Block children of one style are batched into a single wire, and a plinegen wire carries its dash distance across the joins. Every LINE wire is plinegen, so each line in a block began mid-dash wherever the previous one had stopped. PLINEGEN governs a wire's own breaks; a member without any now enters its batch as non-plinegen. Co-Authored-By: Claude Opus 5.5 --- src/scene/cache/block_cache.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/scene/cache/block_cache.rs b/src/scene/cache/block_cache.rs index fdbbb62c1..ddddc40fd 100644 --- a/src/scene/cache/block_cache.rs +++ b/src/scene/cache/block_cache.rs @@ -2630,6 +2630,15 @@ fn emit_wire( && lw.plot_visible && (!lw.plot_l0 || ctx.l0_plottable); + // Batched wires share one dash distance, which runs on across the NaN + // joins only for plinegen wires. PLINEGEN is about a wire's own breaks; + // a member without any (every LINE) must not carry its pattern into the + // next member, or each line in a block starts mid-dash where the last + // one stopped (#898). A member with stations keeps its own flag. + let plinegen = lw.plinegen + && (has_stations + || transformed_stations.is_some() + || lw.points.iter().any(|point| point[0].is_nan())); let key = style_key( final_color, lw.contrast_bg, @@ -2642,7 +2651,7 @@ fn emit_wire( final_world_width, point_marker, final_aci, - lw.plinegen, + plinegen, lw.is_fill_only, lw.fill_is_2d_solid, lw.fill_is_3d, @@ -2679,7 +2688,7 @@ fn emit_wire( final_world_width, point_marker, final_aci, - lw.plinegen, + plinegen, lw.is_fill_only, lw.fill_is_2d_solid, lw.fill_is_3d,