The main window's scale spin box (spnScale) has 2 decimals. Precise scales
computed by the Printing Scale dialog are rounded by setValue(), e.g. 0.4677
(X-dimension 0.33mm, 72dpi, vector) becomes 0.47, and the rounded value is
used for encoding (m_bc.bc.setScale(spnScale->value())). The output then no
longer matches the entered X-dimension (here by +0.5%).
In addition, MainWindow::size_msg_ui_set() ("Scale trumps stored
X-dimension") compares the scale recomputed from the stored X-dimension with
the rounded spin box value using exact float equality, and on mismatch
overwrites the stored X-dimension. Together with the rounding, scale and
X-dimension drift away from the user's input on each recompute, e.g. whenever
the dialog's file type or resolution is changed.
The attached patch (against current master 94fdc846):
spnScale decimals 2 -> 4Builds against Qt 6.4.2; all test_qzint tests pass (103).
Related, not addressed by this patch: QZintXdimDpVars.filetype defaults to
0 (raster), so an X-dimension entered while the dialog's file type is left on
its default gets the raster half-integer scale quantisation even when saving
as EPS/SVG (e.g. 0.33mm at 72dpi ends up as exactly 1pt per module). Deriving
the file type from the actual export format would avoid this. I can propose a
separate patch if that approach is acceptable.
Thanks very much, applied with commit [0ae273].
A patch (or Merge Request) for the
filetypeissue you mention would also be most welcome.Regards, Martin
Related
Commit: [0ae273]