* SVG export: preserve document unit in viewBox and width/height (#864)
When exporting SVG documents with physical units (mm, cm, in, pc), emit
the physical unit suffix on the root <svg width=... height=...>
attributes while keeping viewBox numbers and inner coordinates in 1:1 points
per SVG 1.1 coords §7.10. This avoids the 75% scaling mismatch when opening
drawings in external tools such as Inkscape or LightBurn, and preserves
the document unit setting across save/open round trips. Unitless documents
(points, pixels) continue to emit unitless dimensions.
Tested via export_physical_units_writes_unit_suffixes in vectorcraft-svg
and full round-trip svg_round_trip_preserves_document_units in vectorcraft-engine.
Ran cargo xtask ci (fmt, clippy, tests, xtask gates).
* SVG export: preserve nonzero width and viewBox on extreme small dimensions
Both glyph grids give their list a least height of 64 pt when the panel
leaves less room. The column count compared the rows with the room
left, so with 48 pt left two rows of twelve 22 pt cells, which fit in
the 64 pt list, made room for a bar, and the grid went to eleven
columns and a third row that scrolled. The count now uses the list's
height as drawn.
- A drop-down list that draws its own rows (blend modes, warp styles,
tracing presets) has no current option for the list to show. It
opened at its first row since the change that opens option lists at
their current option. It now opens where it was scrolled when it
closed, as before that change, and the scroll is put back after the
list takes its height beside the field: the list is taller on the pass
it opens, and the scroll was clamped to that height.
- When several options have the current name, the list scrolls to the
first of them.
- The Color Picker's heading set the dialog to the width of its content
without the scroll bar's column, and the body then left out that
column a second time. In a window 448 pt wide and 380 pt tall the
heading measured the columns side by side while the body stacked
them. The heading now keeps the column in the width.
- The Glyphs panel counts a row of its two smallest cell sizes at the
height it is drawn, a button's height, so a grid whose rows run past
the list leaves room for the bar.
The test chose the last format Export As lists. A test running beside it
can add an exporter plug-in's format after the built-in ones, which
moves that end of the list. The test now chooses the built-in format
six from the end of the built-in ones, which is out of view when the
list opens at its top and keeps the same rows around it whether or not
a plug-in format follows.
A drop-down list measures itself against the whole window on the pass it
opens and takes the room beside its field on the next pass. The current
option was scrolled into view only on the first pass, so where the room
beside the field was less than half the list, the option could end up
below the rows shown. It now scrolls into view on both passes.
The new test opens a 20-option list in windows 260 and 180 points tall
with the current option at its end, in its middle and near its start,
and checks that the option shows whole inside the list's clip.
A drop-down list now opens scrolled so that its current option sits in
the middle of the list, or as near to it as the list's ends allow, so
the option shows whole. A list that fits opens at its first option, as
does one with no current option.
The Format list test chooses the last format, checks that it shows
whole and that the list opens again at the same rows after a scroll,
and checks that the theme gives every scroll area the bar at rest.
Export for Screens' test picks GIF after SVG, since PNG is no longer in
view when the list opens with SVG in its middle.
While the picker's content scrolls, its field and columns are sized to the
window's width less the scroll bar's column. Before, the content filled the
whole width, so with dialogs that scroll sideways when too wide (#8529), in
an app window 504 to 624 pt wide and 380 pt tall the picker scrolled
sideways as a whole and showed no bar beside its content.
The Export As test now also checks that the wheel scrolled the Format list
before it checks that the list opens again at its first format.
The PDF writer dates each file and makes its IDs from the clock, so two
sheet exports on either side of a second boundary differed there and the
test failed on main's coverage run.
Each <textPath> with an href walked the whole document to find the element it names, so a file with many texts on paths took time proportional to the number of texts times the number of elements. The importer now builds a map of element ids at the first such lookup, keeping the first element in document order for each id, and looks each href up there. Files whose texts name no element do not build the map. The imported document is the same: a test compares the whole document and warnings with the per-id walk, including duplicate, missing and unusable ids.
Clicking between app windows (floating panels and the canvas) passes through one frame where none of them has focus. The palette levels counted the app inactive on that frame and lowered every floating panel's OS window. The panels flickered, could end up disappearing behind the main window until the next repaint, and a click on one panel's bar could hand the keyboard to another.
The app now counts as inactive once none of its windows has had focus for 0.25 s, counted from the first frame that saw none. craft-ui's docking waits as long.
Fixes#6986
- The French script error line now has the catalog's no-break spaces before its colons.
- es.tsv drops the old file.info control character row a merge brought back.
Two PRs merged tonight each added the same row, so bundled_catalogs_are_consistent fails on main
(gu: duplicate "" "Panel"). Both rows have the same translation.