elksharp-svg: fix bridge gap detection for short segments near bends

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) <noreply@anthropic.com>
This commit is contained in:
master
2026-04-06 15:58:20 +03:00
parent df07bcfd24
commit 16f2f78462

View File

@@ -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)