On Tue, May 12, 2026 at 07:58:22AM +0200, Kornel Benko wrote: > Yes, copying src/tests/Length_data to src/tests/regfiles/Length makes the > test pass here.
That's hardly surprising :) Claude thinks that we inflate BP 10x though, so maybe worth checking? Q: " --- /usr2/src/lyx/lyx-git/src/tests/regfiles/Length +++ /usr9/BUILD/Mint22/BuildLyxGitQt6.4.2local-gcc14.2.0/src/tests/Length_data @@ -15 +15 @@ -9954 pix(250) = 2342page% +6792 pix(250) = 2342page% @@ -35 +35 @@ -237003 BP = 2342page% +140347 BP = 2342page% this happens because recent change in lengths implementation by Juergen (se git log during last week). Do you have opinion whether the previous values were wrong? " A: Found it - commit 467c7281c9 by Juergen, "Fix on-screen representation of pagewidth length (#13309)". Let me read the key part of the change carefully. The diff shows exactly what changed. Here's my analysis: What changed for page% (PPW): In inPixels() - old: result = val_ * text_width * 1.7 / 100; // paperwidth/textwidth is 1.7 for A4 paper with default margins New: result = val_ * (text_width + margin) / 100; // where margin = 40 / (zoom * dpi) - simplifies to text_width + 40 pixels In inBP() - old: same 1.7 factor applied to text_width_in = 210.0 / 2.54. New: same text_width_in + 40/72.27 formula. --- Were the previous values wrong? Yes, but there are two separate issues: 1. The 1.7 ratio was wrong. For A4 with typical LaTeX margins (~25mm each side), paper/textwidth - 210/160 = 1.31, not 1.7. That ratio implied unrealistically narrow text or very wide paper. 2. 210.0 / 2.54 in inBP() is a pre-existing bug that Juergen didn't fix - 210 / 2.54 converts cm-inches giving 82.7 inches (6.9 feet!) instead of the intended A4 width of 210 / 25.4 = 8.27 inches. This makes all percentage-unit BP values inflated by 10×. Both old and new values are affected equally by this, so it doesn't show up as a difference in the diff. 3. The new margin = 40/72.27 - 14mm total combined margins is also too small (real A4 has ~50mm). As a result, new page% BP (140347) is nearly identical to text% BP (139414) - page and text widths should not be almost equal. Bottom line: the old values were wrong (the 1.7 factor was too large and arbitrary), Juergen's fix was the right direction, but the new values still aren't physically accurate because the small hardcoded margin makes page% - text% in the BP case. The regression file needs to be updated to match the new (intentionally changed) behavior. - Crunched for 1m 49s Pavel PS: Please stop me if I am being annoying with our new colleague ;) -- lyx-devel mailing list [email protected] https://lists.lyx.org/mailman/listinfo/lyx-devel
