Plot: thin lineweights keep their true width (#1749)

Every weight under 0.26 mm was clamped to the screen's 1 px floor before
the PDF and SVG exporters saw it, so 0.00, 0.09, 0.13 and 0.25 mm all
plotted alike. The floor now applies on the GPU only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-14 12:47:26 +03:00
1 parent 2c062daa03
commit 2ba2d1c0a7
5 files changed
+10 -8

No files matched your search

+3 -3
View File
@@ -2907,8 +2907,8 @@ mod tests {
assert_eq!(response["status"], "completed", "{response}");
// The plotted PDF carries two distinct pen widths — the per-layer
// 0.13 mm / 0.50 mm hierarchy survives the plot style (thin clamps to
// the 1 px floor, so the ratio is the clamped-pixel ratio 1.889).
// 0.13 mm / 0.50 mm hierarchy survives the plot style at its true
// ratio; the screen's 1 px floor does not reach the plot (#1749).
let text =
crate::io::pdf_export::pdf_stream_text(&std::fs::read(&pdf).expect("pdf written"));
let tokens: Vec<&str> = text.split_whitespace().collect();
@@ -2931,7 +2931,7 @@ mod tests {
"two layer weights in the plotted PDF: {widths:?}"
);
assert!(
(widths[1] / widths[0] - 1.889).abs() < 0.15,
(widths[1] / widths[0] - 50.0 / 13.0).abs() < 0.15,
"0.50 mm vs 0.13 mm hierarchy: {widths:?}"
);
let _ = std::fs::remove_file(&pdf);