Spur label: center at wide end (w/2), keep font at 14px
Place text centered at the wide bottom edge where there's always enough room. No font shrinking — the wide end has plenty of space. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3adbfffb9d
commit
ff952c5cb1
@ -556,13 +556,11 @@ 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;
|
||||
// Center in the wider half of the trapezoid (bottom half where w > w2)
|
||||
// At 75% height, width = w2 + 0.75*(w-w2) = w2*0.25 + w*0.75
|
||||
const widthAt75 = w2 * 0.25 + sym.w * 0.75;
|
||||
cx = sym.x + widthAt75 / 2;
|
||||
cy = sym.y + sym.h * 0.75;
|
||||
availW = widthAt75 - pad * 2;
|
||||
availH = sym.h * 0.45;
|
||||
// Place text at the wide end corner of the trapezoid
|
||||
cx = sym.x + sym.w / 2;
|
||||
cy = sym.y + sym.h / 2;
|
||||
availW = sym.w - pad * 2;
|
||||
availH = sym.h - pad * 2;
|
||||
} else {
|
||||
cx = sym.x + sym.w / 2;
|
||||
cy = sym.y + sym.h / 2;
|
||||
|
||||
@ -43,11 +43,9 @@ function emitConveyanceLabelInner(lines: string[], sym: PlacedSymbol) {
|
||||
// Mirror: label follows the mirrored shape naturally
|
||||
textRotDeg = (textRotRad * 180) / Math.PI;
|
||||
} else if (isSpurType(sym.symbolId)) {
|
||||
const w2 = sym.w2 ?? sym.w;
|
||||
const widthAt75 = w2 * 0.25 + sym.w * 0.75;
|
||||
labelCx = sym.x + widthAt75 / 2;
|
||||
labelCy = sym.y + sym.h * 0.75;
|
||||
availH = sym.h * 0.45;
|
||||
labelCx = sym.x + sym.w / 2;
|
||||
labelCy = sym.y + sym.h / 2;
|
||||
availH = sym.h - 4;
|
||||
} else if (isInductionType(sym.symbolId)) {
|
||||
const stripTopY = sym.y + sym.h * INDUCTION_CONFIG.stripTopFrac;
|
||||
const stripBottomY = sym.y + sym.h * INDUCTION_CONFIG.stripBottomFrac;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user