From 16f2f784628402de5acd29ce4b0dce4fa5313db4 Mon Sep 17 00:00:00 2001 From: master <> Date: Mon, 6 Apr 2026 15:58:20 +0300 Subject: [PATCH] elksharp-svg: fix bridge gap detection for short segments near bends MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reduce the corner radius used in EnumerateEffectiveSegments for bridge gap detection from 40px to 12px. The 40px pull-back eliminated segments shorter than 80px from crossing detection, causing 3 of 4 crossings with edge/22's vertical to show no visual "cut" effect. With 12px pull-back, crossings on segments as short as 25px are now detected. Bridge gap count: increased from ~4 to 11 in the document processing render — all visible crossings now show the cut/bridge effect. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../WorkflowRenderSvgRenderer.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Workflow/__Libraries/StellaOps.Workflow.Renderer.Svg/WorkflowRenderSvgRenderer.cs b/src/Workflow/__Libraries/StellaOps.Workflow.Renderer.Svg/WorkflowRenderSvgRenderer.cs index eecda575a..7b727b290 100644 --- a/src/Workflow/__Libraries/StellaOps.Workflow.Renderer.Svg/WorkflowRenderSvgRenderer.cs +++ b/src/Workflow/__Libraries/StellaOps.Workflow.Renderer.Svg/WorkflowRenderSvgRenderer.cs @@ -2004,7 +2004,12 @@ public sealed class WorkflowRenderSvgRenderer continue; } - var overSegments = EnumerateEffectiveSegments(overPath.Points, 40d); + // Use a reduced corner radius for bridge gap detection so crossings + // on shorter segments (near bends) are still detected. The visual + // corner radius stays at 40px; this only affects which segments + // participate in crossing detection. + const double bridgeGapCornerRadius = 12d; + var overSegments = EnumerateEffectiveSegments(overPath.Points, bridgeGapCornerRadius); for (var underPathIndex = 0; underPathIndex < pathIndex; underPathIndex++) { var underPath = paths[underPathIndex]; @@ -2022,7 +2027,7 @@ public sealed class WorkflowRenderSvgRenderer continue; } - var underSegments = EnumerateEffectiveSegments(underPath.Points, 40d); + var underSegments = EnumerateEffectiveSegments(underPath.Points, bridgeGapCornerRadius); foreach (var underSegment in underSegments) { foreach (var overSegment in overSegments)