Anchor net labels to routed segments to avoid floating labels
Some checks are pending
CI / test (push) Waiting to run

This commit is contained in:
Rbanh 2026-02-19 23:55:00 -05:00
parent cc20c0cc25
commit f0b952e3a2

View File

@ -643,6 +643,10 @@ export function renderSvgFromLayout(model, layout, options = {}) {
if (routeInfo?.labelPoints?.length) { if (routeInfo?.labelPoints?.length) {
candidates.push(...routeInfo.labelPoints); candidates.push(...routeInfo.labelPoints);
} }
const routeCenter = representativePoint(routeInfo, netAnchor);
if (routeCenter) {
candidates.push({ x: routeCenter.x + 8, y: routeCenter.y - 8 });
}
if (netAnchor) { if (netAnchor) {
candidates.push({ x: netAnchor.x + 8, y: netAnchor.y - 8 }); candidates.push({ x: netAnchor.x + 8, y: netAnchor.y - 8 });
} }