The frame after a document opens checked whether its Missing Fonts dialog
waits by building the whole dialog (opening::may_switch), and the dialog
pump then built it again to open it. Each build walked the document's type
and resolved every font it names: 6.5 ms over the two calls at 20,000
objects.
The rows are now kept in CanvasCache::missing_fonts for the document's
content version and the font database's generation, the same key Type ›
Find Font's cache uses, and both calls read them. An edit or a font that
loads while the dialog waits makes the next call list the fonts again. The
Fonts folder next to the document is still looked up when the dialog opens.
Rows are dropped once their document no longer waits.
text.missingFonts's answer is unchanged; its rows and its folder are now
two engine functions, missing_font_rows and fonts_next_to_document.
Tests count the row lists (one for the check and the open together) and
check that a document edited while its dialog waits lists its new font.
The app's root look now sets PresetCardLook::PageTile in place of Page,
so each preset card in New Document draws on a light veil of the scrim
with its paper on it. A card that is not selected now stands apart from
the dialog's surface. The craft-libs pin at 186a229c8d already has the
look (storytold/craft-libs#4180).
The new test resting_preset_cards_stand_on_a_tile checks that a resting
card is covered by a veil of the scrim and holds its white paper; it
fails with the old Page look.
Both dialogs closed on OK before the app checked the document and slices
they opened with, so a refusal (the selection changed, the document was
reverted, or the command failed) went to the status line and the typed
values were lost. They now open through the held-OK host: the check and
the command run while the dialog waits, a refusal shows its reason under
the rows with the values kept, and OK applies once the opening slices are
selected again.
The tool host asks the canvas tool for its cursor in every pass with the
pointer over the canvas. The selection tools answer by hit-testing the
art under the pointer, so each frame of a wheel pan or zoom under a
resting pointer walked every object. The canvas now keeps the cursor
the tool last gave for the same tool and keys while the view moves,
and asks again once the view has been still for HOVER_STILL_SECS, as
it already does for Object Highlighting and the shown tool (#2452).
The canvas built the outlines, anchors and dots of the selection again in
every pass, walking every selected object three times (the outlines, the
anchors and the dots each count the marks first). They are now kept in the
canvas cache with a key of the document's uid and revision, what the view
hides, Halftone Preview, the tool whose marks show and the Selection &
Anchor Display preferences, and built again only when that key changes.
With 10,000 rectangles selected, an idle frame went from about 290 ms to
about 210 ms on the build host.
The canvas measured the art and artboards of the whole document in every
pass to size its view target, so a frame cost grew with the object count.
view_target now reads content_bounds_of, which keeps one measure per open
document and measures again only when that document's revision moves.
The status bar's Zoom field, Rotation menu and artboard navigator now show
in a MemoView keyed on the view, the artboard, the document revision and
the language, so idle frames replay them instead of laying them out.
As asked in review. Cargo.toml: main moved craft-libs to 51fcc3b0; the font
store crates this branch adds move with it, so every craft-libs crate stays
at one rev.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The plug-in runtime keeps main's JavaScript plug-ins beside the web worker's module bytes and checked loads: a JavaScript plug-in's bundle is kept for the worker like a module, and load_checked loads it from its bundle.
tests::automation::a_screenshot_is_issued_by_the_apps_frames_and_written
failed on a loaded machine with "screenshot 0 timed out: no frame was
presented within 8 s": the capture's settle delay and its 8 s deadline
started on the wall clock inside ControlChannel::settle, so a slow run
reached the deadline before a frame issued the capture.
The app now times control requests and captures on its own clock,
VectorcraftApp::instant: the monotonic clock, or now_override seconds
after the app was made when a test sets it. run_control admits each
screenshot with ControlChannel::settle_at at that instant, and the
drain, the request-expiry check and issue_captures read the same
clock. Behavior outside tests is unchanged.
The test starts the app's clock twice the deadline past the wall clock
and steps it one frame per pass, so the capture is issued after its
settle delay on that clock. With the admission or issue still on the
wall clock, the test fails with the timeout error above.
All storytold/craft-libs crates and the hayro, krilla and linesweeper
patches move from b0d422cf0c to 51fcc3b041, the head of craft-libs main
(craft-libs#3718). craft-libs main now holds what was on next, so the
pin follows main as AGENTS.md rule 10 asks. The move brings the .cmx
writer (craft-libs#2807) and the macOS Save sheet Format menu
(craft-libs#3565). xtask pdf-deps expects the new rev.
The egui patches move from b15ffe9bfc to 932a73b285, the egui rev
craft-libs main pins: craft-ui-contract at 51fcc3b041 calls
Context::set_pointer_move_gate and Context::widgets_at, which
storytold/egui adds after b15ffe9bfc.
App changes the move needs:
- AppShell's title, options, status and hint slots take a version
function (craft-libs c417cd3050). Each passes |_| None, so every slot
still runs in every pass.
- PartResult::hover_pos is private (craft-libs 27e8a77145). The track
cube reads the pointer through Cx::hover_pos, which is None when the
cube is not hovered, as the old filter on hovered was.
- craft_dxf::write_binary returns a Result (craft-libs#3347, binary DXF
writing fails on an invalid integer). The binary DXF import test
unwraps it.
Test changes the move needs:
- An inline slider field now shows its slider before its number field,
and both carry the field's name (craft-libs#3553). The panel harness
types into the number field, the part that takes typing, and the
plug-in effect test reads the number field's value.
- A painted tool cursor's marks use the overlay.cursor token (craft-libs
a830ff539b), so the cursor test looks for that color.
- The Keyboard Shortcuts area tabs are named by their visible label,
"Show:" (craft-libs 702cb295c6).
- The gradient stop's color mode menu now opens over part of the stop
editor. The test clicks the Web Color Sliders row where it lies
outside the editor, as before, and keeps the same checks.
Cargo.lock adds what the new craft-libs crates depend on
(craft-control-protocol, craft-font-os-windows, ed25519-dalek and its
dependencies, jpeg-encoder 0.7.1 for craft-image-codecs).
Part of #4936. Spelling and hyphenation now read the Language packs
installed in the font store the Craft apps share, and proof.packs,
proof.installPack and proof.removePack list, install and remove them.
Installs need downloading on, which only the person turns on; in the
desktop app they run in the background and the documents are laid out
again when one ends.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The view info the canvas gives the tools never set its precise flag, so
the Blob Brush and the Eraser drew their tip outline around the precise
crosshair whatever the setting. Nothing passed the host's Caps Lock
state to the session either, so `view.capsLock` changed nothing.
- The view info's precise flag is on while Use Precise Cursors or Caps
Lock is on, as before the move to the shared canvas.
- The canvas passes each change of the host's Caps Lock state to
`view.capsLock`; a `view.capsLock` call stays in effect until the next
change.
- The canvas's pointer follows the same flag, so with both on the
drawing tools keep the crosshair.
In a document whose frames take over 8 ms, every frame of an edit went to
the render worker once the frame shown came from it, so a Pen drag's curve
trailed the pointer by the worker's render time plus the wait for a busy
worker. The changed part of a worker's frame is now drawn again on the UI
thread, as it already was for frames rendered there, when the part's share
of the frame's last render time is at most 8 ms.
The part is not drawn there, and the frame goes to the worker as before,
when the frame shown drew raster effects made before their objects moved,
holds pixels copied from the worker's last frame, or drew art in a way that
depends on the frame's size, or when the part itself draws such art. A
worker frame on its way blocks the part only when it is of another document
or not older than the edit.
Part of #8296.
The Paintbrush with a brush whose Size or Width is on Stylus Wheel with
a range the wheel can change, or the Eraser with a value on Stylus Wheel
and a variation above 0, uses the wheel. The app asks the active tool
(Tool::reads_wheel) once a frame and tells the host when the answer
changes (Services::stylus_wheel). Until a tool uses the wheel, a pen
message loads no Wintab32.dll, installs no hook, subclasses no window
and opens no context; when it stops, the context closes.