diff --git a/svelte-app/src/lib/canvas/renderer.ts b/svelte-app/src/lib/canvas/renderer.ts index 4989ee5..cdbedfc 100644 --- a/svelte-app/src/lib/canvas/renderer.ts +++ b/svelte-app/src/lib/canvas/renderer.ts @@ -556,8 +556,8 @@ function drawConveyanceLabel(ctx: CanvasRenderingContext2D, sym: PlacedSymbol) { let cx: number, cy: number, availW: number, availH: number; if (isSpurType(sym.symbolId)) { const w2 = sym.w2 ?? sym.w; - // Place text at the wide end corner — no horizontal padding needed - cx = sym.x + sym.w / 2; + // Center text in the right half (wide area) of the trapezoid + cx = sym.x + (w2 + sym.w) / 2; cy = sym.y + sym.h / 2; availW = sym.w; availH = sym.h; diff --git a/svelte-app/src/lib/export.ts b/svelte-app/src/lib/export.ts index 2595fb1..c6d788d 100644 --- a/svelte-app/src/lib/export.ts +++ b/svelte-app/src/lib/export.ts @@ -43,7 +43,8 @@ function emitConveyanceLabelInner(lines: string[], sym: PlacedSymbol) { // Mirror: label follows the mirrored shape naturally textRotDeg = (textRotRad * 180) / Math.PI; } else if (isSpurType(sym.symbolId)) { - labelCx = sym.x + sym.w / 2; + const w2 = sym.w2 ?? sym.w; + labelCx = sym.x + (w2 + sym.w) / 2; labelCy = sym.y + sym.h / 2; availH = sym.h - 4; } else if (isInductionType(sym.symbolId)) {