mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-19 16:55:55 +00:00
Image Trace: the panel finds the object Trace acts on once per document revision
On every frame the Image Trace panel put the whole selection in paint order twice and scanned it a third time to find the object Trace acts on; its panel menu scanned it again. The panel and its menu now look it up once for each document revision and reuse the result on later frames. The lookup puts only the selected images and Image Trace objects in paint order, and reads the target in place instead of copying it. The target, its flags, its stored settings and whether any selected object is an Image Trace object are the same as before, field for field. With 100,000 selected paths in nested groups and one selected image, a frame's lookups took a median 120 ms before; the first frame after a change now takes 10 ms and later frames about 50 ns.
This commit is contained in:
@@ -1647,6 +1647,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **Image Trace, Flat Logo working size:** Flat Logo traces at most 1024 px on a side; a larger decoded raster (the 64-megapixel copy for a bigger image) is averaged down in whole-number blocks first, and the trace's `warnings` name the size it was traced at and the image's own size, in place of the slower-trace and 64-megapixel notes; code-drawn 1024 and 1025 px tests in `crates/trace` and `crates/engine`.
|
||||
- **Image Trace, Flat Logo working size:** Flat Logo traces at most 1024 px on a side; a larger image is averaged down by a whole factor first, and the trace's `warnings` name the size it was traced at and the image's own size, in place of the slower-trace and 64-megapixel notes; code-drawn 1024 and 1025 px tests in `crates/trace` and `crates/engine`.
|
||||
- **Image Trace, Preview:** the Image Trace panel's Preview checkbox, before Trace, is on by default, and a setting change traces the selected Image Trace object again at once. Off, changes wait in the panel until Trace applies them as one undo step, or until Preview is turned on again. Changes stay with the object they were made for while another object is selected. When Preview is turned on with that object not selected, the object is traced with its changes when it is selected again. Preview is kept with the UI preferences, and Reset to Default leaves it. The `imageTrace.preview` command turns it on or off.
|
||||
- **Image Trace, the panel's object looked up once per revision:** the Image Trace panel and its panel menu find the object Trace acts on once for each document revision and reuse it on later frames, and put only the selected images and Image Trace objects in paint order instead of every selected object. The panel acts on the same object with the same settings. With 100,000 selected paths in nested groups and one selected image, the earlier lookups took a median 120 ms per frame (wall-clock time on Linux, release build with thin LTO off, while other builds were running); the first frame after a change now takes 10 ms and later frames about 50 ns (`panels::image_trace::tests::the_target_lookup_matches_sorting_the_whole_selection`, `the_panel_looks_its_target_up_once_per_document_revision`, `image_trace_target_lookup_timing`).
|
||||
- **Image Trace, traces made off the UI thread stay with their document:** a trace made away from the command (`TraceRun`) applies only in the document it was made in. In another open document with the same image, object and settings, `imageTrace.make` and `imageTrace.makeAndExpand` drop it and trace that document's image, as one undo step (VectorCraft's own rule). Test: `a_trace_run_applies_only_in_its_own_document` in `crates/engine`. Scores and hours unchanged.
|
||||
- **Image Trace, a trace started before File › Revert does not apply after it:** the reverted document keeps its tab, but a trace prepared before the revert no longer applies, even when the restored image, object and settings are the same. A background trace that finishes after the revert changes nothing and the status bar says the document was reverted; a result handed to `imageTrace.make` or `imageTrace.makeAndExpand` is dropped and the restored image is traced again, as one undo step. Reverting another document, or a revert that fails, does not affect the trace (VectorCraft's own rule). Tests: `a_trace_run_prepared_before_a_revert_does_not_apply_after_it` in `crates/engine`, `a_trace_started_before_a_revert_does_not_apply` in `crates/ui-egui`. Scores and hours unchanged.
|
||||
- **Image Trace small contours:** closed fits too small to form an editable subpath retain their positioned outline, including holes. Source-generated island, hole/winding and stepped-region regressions cover Corners and Noise; defaults, parity scores and estimates are unchanged.
|
||||
|
||||
Reference in New Issue
Block a user