cmd_or_ctrl_suspends_guide_snapping dragged a guide out of the ruler with Control alone held. On macOS a primary press with Control is a secondary press (craft-libs control_click), so no guide was dragged and the test failed there; CI has no macOS. The test now holds the platform's command key, which suspends snapping on every system.
Follows the page-only scan of the retained canvas:
- Pattern sources come from every paint a layer draws with: its fills
and strokes, and also its vector regions' own fills and its text runs'
own fills. Before, the scan read only fills and strokes, so an edit to
the source of a region's or a run's pattern left the canvas stale
unless that source also filled an ordinary layer somewhere in the file.
- A layer inside pattern sources is walked once, so a real tree stays
within the walk's budget of three visits a layer.
- A child list that repeats (a hostile file) runs out the budget; the
scan then counts every layer of the file, as it did before the page
scan, instead of what it had reached.
New tests: glass and a small blur on the page with a wider blur on
another page (full renders, a pan, an edit and band-by-band renders
against render_view), a looping child list over blurs, and a vector
region filled with a pattern from another page. Each fails with its
part of this change taken out.
The explanations of render_part, render_bands, render_columns and
band_overlap now sit on the functions the canvas calls.
large_doc_digests prints the same digests as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two tests asserted the drag sprite is still up one frame after the
release or cancel. A small render can finish within that frame, and the
canvas then rightly drops the sprite, so the tests failed at random
(mostly under SonarCloud's instrumented run). They now check what must
hold: the sprite stays until a render leaving no layer out is shown.
Each box pass divided four channel sums by the box's width for every
pixel. The width is the same along a row, so the division becomes a
multiply by its rounded-up reciprocal and a shift, exact for every sum a
box can hold (at most 255 times its width); widths past 2^23 pixels,
which no blur reaches, keep the division. The bytes are the ones the
reference blur gives (blur_matches_the_reference_bytes), and a new test
checks every quotient for box widths up to 4,001 and the widest ones.
blur_timings, release, Apple M5 Pro, best of runs alternating the two
builds (ms, before -> after):
| pixmap | sigma | parallel | one thread |
|---|---:|---:|---:|
| 1700 x 1200 | 48 | 2.28 -> 2.09 | 24.16 -> 16.52 |
| 1700 x 1200 | 12 | 2.32 -> 2.11 | 23.24 -> 15.89 |
| 600 x 400 | 6 | 0.49 -> 0.39 | 2.71 -> 1.88 |
One thread is how a band of a parallel render and the browser blur.
Whole frames gain less. large_doc_timings, the page with a background
blur and a glass pane, minimum of 10 alternating runs at a load average
under 4 (ms, before -> after):
| frame | blur here |
|---|---:|
| scan after an edit | 0.77 -> 0.78 |
| edit one layer | 8.01 -> 6.90 |
| zoom (100%) | 17.45 -> 16.60 |
| zoom (400%) | 29.26 -> 29.56 |
| pan 60 px | 3.05 -> 2.80 |
The 400% zoom is unchanged: most of it is not the box passes.
pan_render_timings, zoomed_card_timings and glass_render_timings move
by no more than run-to-run noise. large_doc_digests and glass_digests
print the same digests as before.
Tried and left out: drawing a blur reaching past a band in fewer, taller
bands rather than in one piece (zoom at 400% with the blur: 29.1 ->
37.5 ms, as a blur on a band's thread is not split across threads), and
splitting the box loop into its edges and middle (no change measured).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host page that opts in with `?save=managed` (or `data-save="managed"`
on the canvas) now gets each Save and Save As of the document with an
`id` (`save-1`, `save-2`, ...), and the document keeps its unsaved
changes until the host answers `figcraft:saved` with that `id`. Hosts
that don't opt in see no change: a file still counts as saved once it is
posted.
- `host_saves.rs`: the bookkeeping, apart from the browser so it is
tested natively. One save waits at a time; a newer one replaces it;
answers for any other `id` are ignored; a file the host opens forgets
the waiting save; a save unanswered after 30 s counts as not stored
(the clock is passed in). A Save As becomes the document's file only
once confirmed, so a retry after a failure is still `saveAs: true`.
- `host.rs`: the listener only queues what the host sent; the shell
handles it in order each frame. Exports and copies carry no `id` and
`saveAs: false`. A timeout tells the user and posts `figcraft:failed`
with the `id`, and the app wakes itself for it.
- ui-egui: `Services::deliver_document` hands the document's own file
over (its default is `download`, so desktop and plain browser saves
are unchanged). `Delivery::Pending` skips `file.markSaved`;
`FigApp::document_stored` and `document_not_stored` finish the save.
- engine: `FileSnapshot::delivered` marks the snapshot's tab saved as of
the snapshot, so edits made while the save was in flight stay unsaved,
and a tab closed or saved since is left alone. It shares its tail with
`FileSnapshot::save`.
`craft-web-host` at the pinned rev has no host-to-app refusal message
and no `host {confirmsSaves}` handshake (storytold/craft-libs#1338), so
a host's refusal shows as the timeout until the crate adds them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
What the retained renderer works out about a page (grainy layers to
redraw whole, pattern sources whose edits show, the largest backdrop
blur) came from passes over every layer of the file, after every edit
and before every zoom. It now comes from one walk down the page shown,
following the pattern sources it fills with wherever they are (and the
sources those fill with). A zoom reuses what the last render found for
the same document, page and fonts.
Partial renders, the canvas's full renders and the browser's banded
renders take the page's backdrop radius, so a blur on another page no
longer widens pan strips and patch margins, and no longer stops a full
render from drawing in parallel bands. render_view keeps the file's
radius.
Release timings on an Apple M5 Pro, 100,000 layers on five pages,
1600 x 1100 px, minimum of 8 runs alternating the two builds (ms,
before -> after; the machine was shared with other builds):
| frame | cards | blur here | blur elsewhere | flat |
|---|---:|---:|---:|---:|
| scan after an edit | 3.11 -> 0.80 | 3.09 -> 0.79 | 3.27 -> 0.79 | 3.07 -> 0.82 |
| edit one layer | 5.31 -> 2.77 | 10.57 -> 7.95 | 7.43 -> 2.79 | 7.06 -> 3.30 |
| zoom (100%) | 9.60 -> 6.67 | 20.62 -> 17.85 | 13.53 -> 6.71 | 6.72 -> 3.61 |
| zoom (400%) | 5.78 -> 2.75 | 32.62 -> 29.42 | 18.04 -> 2.77 | 5.86 -> 3.03 |
| pan 60 px | 0.69 -> 0.70 | 3.05 -> 3.10 | 2.16 -> 0.69 | 2.84 -> 2.95 |
large_doc_digests hashes 65 frames of pans, edits and zooms over five
scenes (pattern fill with an off-page source, noise, background blur,
glass included); both builds print the same digests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`export`, `convert` and `run --out` take `--strict`. When the .fig,
.penpot or Android Vector Drawable writer reports anything left out or
changed, nothing is written or replaced and the command exits 1 with the
reasons on the error line. A folder of drawables is written only once
none of its files leaves anything out. `--strict` with an output whose
writer reports nothing (png, svg, pdf, ...) or with `--vd-compat ignore`
is a usage error (exit 2), so it never passes without checking anything.
A .figcraft output is accepted for convert and run: it keeps everything.
.fig export writes a vector whose filled areas use both winding rules as
one fillGeometry path per rule, so other readers fill each area as the
network does. The warning that the outline used the first area's rule is
gone.
Image adjustments, list spacing, hanging punctuation and lists, and
vertical trim were already written on main. OpenType features,
variables' publishing, code syntax and inheritance settings, prototype
device settings and text styles on part of a text keep their warnings:
the .fig import (craft_fig's mapping at the pinned craft-libs rev) does
not read them back, so they cannot round-trip yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Five pages of 20,000 layers: cards, cards with a background blur and a
glass pane on the page shown or on another page, and a flat page. Rows
time the retained renderer's scan after an edit, an edit, a zoom at 100%
and 400% and a 60 px pan.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The device-scale detail drawn over a tall frame's capped texture waited
out only a fling, a drag and the wheel. A zoom, a window resize, a move
to a display of another scale or any other change of the view rendered a
new detail, up to 16.8 million pixels on the UI thread, on every frame it
changed. Any change of the page area in view or of its pixel scale from
one frame to the next now counts as motion: the capped texture shows
alone meanwhile, and a frame is asked for so the detail for the still
view is rendered next.
The desktop app and figcraft-cli trusted only the compiled-in public
roots and FIGCRAFT_CA_FILE, so a server behind a proxy with a private
authority needed that variable on every computer. They now also add the
authorities in the operating system's certificate store, unless
FIGCRAFT_NO_SYSTEM_ROOTS is set. Certificates are still always
verified.
With all 8 connection slots taken, a new client now takes the slot of
the connection that has waited longest for its client; a connection
whose request the app is running keeps its slot. Request lines are
counted as they arrive against 64 MiB shared by all connections until
they are answered, so eight clients can no longer make the app hold
eight 32 MiB lines and their parsed trees.
A whiteboard file's connectors came in as loose vectors, so moving a
shape left them behind. On a whiteboard the mapper's adapter now writes
a board connector on each connector drawn as one line on the page: its
ends name the layers it joins (a named magnet is that side, an automatic
one the side facing the other end, an end without a magnet keeps its
point on the layer) or a free page point, with its routing. The REST
importer makes the vector a native board connector once every layer is
in, so the board routes it again when what it joins moves. The import
report counts only the connectors that stayed vectors. Labelled
connectors, connectors inside frames and connectors in design files are
unchanged.