Fix: viewport line weights no longer scale with viewport zoom

line_weight_px was multiplied by the viewport scale factor, making lines
near-invisible at small scales (e.g. 1:100) and overly thick at large
scales (e.g. 5:1). Line weights represent physical pen widths on the
plotted sheet and must be constant regardless of viewport scale.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-03-31 13:17:42 +03:00
commit f01e4f69be

View file

@ -707,8 +707,8 @@ impl Scene {
let mut out = wire.clone();
out.points = clipped;
out.color = [r * 0.80, g * 0.80, b * 0.80, a * 0.85];
// Scale line weight proportionally for correct visual thickness.
out.line_weight_px = wire.line_weight_px * scale;
// Line weights are paper-space pen widths — independent of viewport scale.
out.line_weight_px = wire.line_weight_px;
result.push(out);
}
}