docs: ADR 0138, the backlog, parity and the changelog for P-013 and P-016 (M1)

This commit is contained in:
Tanish Manku committed 2026-11-27 23:49:25 -07:00
1 parent f25ee66308
commit 85b3990fe3
5 files changed
+119 -8

No files matched your search

+2 -2
View File
@@ -22,7 +22,7 @@ People who have contributed to AniCraft. The repository starts from one initial
* nocturney: localisation tests (Hebrew plurals, the product name).
* Vincent Agerbech (va-moviestarplanet): XFL group placement.
* scks1: raw drawings that align, distribute, turn and take strokes as one shape.
* Untoldent: the selection stipple and its gradient detail (#404), the scene breadcrumb, names selected in dialogs.
* Untoldent: the selection stipple and its gradient detail (#404), the scene breadcrumb, names selected in dialogs, the GPU's count of filtered scratch memory in flight (#664), no stale pasteboard fragments while stage tiles are replaced (#669).
* gmrmad1: the zoom field, the Scale lock, playhead and scene-end fixes.
* Koolskull: group registration at the centre of the artwork.
* Kushagra Kumar (kk376): drawing with the camera layer hidden.
@@ -37,6 +37,6 @@ People who have contributed to AniCraft. The repository starts from one initial
* Hagai Baram (hrb9): the Hebrew fallback face, `iw` read as Hebrew, and right-to-left language detection, private-use tags included (#486).
* FredApps: a test that linked artwork survives SVG export and re-import (#500).
* Ayberk A. (AyberkA0): View Only the Active Layer, frame stepping that stops at the ends, a press that selects at once, an empty cell that selects, transparent PNG frames, the marquee that takes what it touches, Distribute to Layers, Match Size and Space Evenly, filter cards that fold, raw shapes moved from Properties, To Stage inside a symbol, aligning by outlines, and a swatch that closes the picker (#572 to #584).
* ViktorBystrov72: stage zoom measured in device pixels, Hide Edges, and fitting the stage to an imported SVG (#590, #588, #587).
* ViktorBystrov72: stage zoom measured in device pixels, Hide Edges, fitting the stage to an imported SVG, and the fitted zoom kept when the zoom field loses focus (#590, #588, #587, #633).
* Neel Patel (N-NeelPatel): Convert Lines to Fills in a shape's properties (#562).
* rcoenen: an imported Animate file that keeps its name, and the macOS crash on closing the window, with the move to egui 0.37 (#596, #594).
+26
View File
@@ -2,6 +2,32 @@
## Unreleased
* **No line of the stage between merged fills** (backlog P-013, ADR 0138, #182). Two fills of
one merged drawing that share an edge, such as a shape cut by a curve, showed a hairline of
whatever was below along it: each was anti-aliased on its own and drawn over the other.
Fills of one drawing are now added up where they meet, on the stage (CPU and GPU), in Test
Movie and in every picture and video export; a mask drawn as several fills no longer leaks
along their edges. The same frame takes the same time to draw (2.4 ms for 1,000 joined fills
at 1280 × 720). Not yet in SVG, HTML and Lottie exports, where the viewer draws each fill.
* **A preference for the marquee** (Preferences › Stage): **The marquee takes objects it
touches**, on as before. Off, a box dragged with the Selection tool takes only the objects
wholly inside it. Headless: `view.select_touching {on}`, and `touch` on `raw.select_rect`.
* **The guide tells the truth** (backlog P-016). Every "not yet" in the guide was checked
against the code. "Coming from Animate" no longer lists as missing what has shipped (moving
the Tools panel, Asset Warp, the Paint Brush, Ctrl+J and the panel keys, saved workspaces,
document tabs, Envelope, bone springs, the brush library and pressure curves, per-character
styles, text on a path), and the drawing chapter covers the Paint Brush, pressure curves and
the Brush Library.
* **From outside, merged with their commits** (M8): leaving the zoom field without typing
keeps a fitted view, and the view's centre is right at very small zooms (ViktorBystrov72,
#633); no fragments of an older picture show on the pasteboard while stage tiles are
replaced (Untoldent, #669); the GPU counts the scratch memory of filtered work still in
flight and hands a tile to the CPU instead of running out (Untoldent, #664; in the browser,
where that can't be counted, filtered layers still draw on the GPU).
* **A test that failed now and then** (`stage_work_is_submitted_only_inside_the_frame`): it
watched the window's submit gate, which every other test that draws a frame opens and closes
from its own thread. It now has a gate of its own; nothing in the app changed.
* **Flash 8 to CS4 `.fla` files open** (backlog P-039, ADR 0120, #163; by rcoenen, #478 and
#481): the binary `.fla` of the Flash 8 to CS4 era, which AniCraft used to refuse, now opens
like an Animate file, untitled, so Save asks for a new `.anicraft` name.
@@ -0,0 +1,83 @@
# ADR 0138: Fills of one merged drawing join without a seam
* Status: accepted (2026-11-27), built
* Relates to: ADR 0031 (merge drawing), ADR 0002 (the render pipeline), ADR 0019 and ADR 0029
(the GPU stage draws what the oracle prepares), ADR 0070 (soft masks), ADR 0122 (a moved raw
selection floats), ADR 0125 (the roadmap as a guideline; backlog item P-013), issue #182
## Context
Merge drawing leaves one element per fill region. Two regions that meet share an edge exactly:
the same Bézier pieces, one traced each way. Each fill was drawn on its own, anti-aliased, one
over the other. In a pixel the shared edge crosses, the first fill covers a part `a` and the
second the rest, `1 − a`, and drawing one over the other lets `a · (1 − a)` of what is below
through: up to a quarter of the stage's colour, as a hairline along every shared edge
(issue #182, a red fill cut by a curve on a white stage). The outlines are right; the mistake
is in treating two coverages of one pixel as if they were independent, when the two fills lie
side by side. It is the same on the CPU oracle and the GPU stage, which composites the way the
oracle does, and in masks, where two such fills united as `a + b − ab`.
## Decision
1. **The display list says which fills are side by side.** `DisplayItem::joins` is set by
`evaluate` on a shape of a merged drawing that follows another shape of the same drawing:
the raw shapes of one keyframe on one layer (a group's, or a symbol's layer's, are drawings
of their own). It is a fact about the document, so every renderer gets it and `evaluate`
stays pure.
2. **A run of joined fills is added up, then composited once.** The renderer makes a run of
consecutive joined fills that are drawn as fills in the same layer, clip and group, with
nothing between them (a fill's own stroke ends the run: it is drawn before the next fill).
Per pixel a run starts transparent, with nothing covered. Each fill, of coverage `k` and
colour `s`, with `c` covered so far:
* hides what it must overlap, `o = max(0, c + k − 1)`: the run's colour times
`1 − o / c · s.a`;
* adds `s · k`, and `c` becomes `min(1, c + k)`.
When the run ends its colour goes src-over onto what is below, times its clip's coverage.
For two fills that share an edge `c + k = 1`: nothing overlaps, the colours add up to full
cover and nothing below shows. Half-transparent fills side by side stay half-transparent
along the edge, where one over the other made the edge denser.
3. **Side by side as far as the pixel has room, one over the other past that.** The rule
takes two partial coverages of a pixel to overlap as little as they can. Where either fill
covers the pixel whole it is exactly src-over, so fills that do lie over each other (a
shape moved onto the drawing and still floating, ADR 0122; a file written by hand) are
drawn as before everywhere except in pixels both their edges cross, and there the
difference is a fraction of a pixel's coverage. We chose this over trusting the flag
blindly (adding without the overlap term), which would brighten or darken overlapping
fills over their whole area.
4. **Masks join the same way.** A coverage mask unites a run's coverage as one fill's; a soft
mask composites the run's colour. A mask drawn as two fills no longer leaks or hides along
their edge.
5. **The oracle defines it, the GPU follows.** `Fill::run` numbers the runs in a prepared
scene. The fine shader keeps the run's colour and coverage per pixel and ends the run at
the first entry that isn't of it; the number rides in the op header's flags. The parity
tests compare both on joined fills in the open, in masks, in a soft mask and in a fading
group.
6. **What it costs.** A pixel a fill covers whole, where the run has nothing yet, is drawn at
once, so only the pixels along edges go through the run's buffers, which each render thread
keeps. A 1280 × 720 frame of 1,000 joined fills takes the oracle 2.4 ms, and 2.5 ms drawn
one over the other (the same within noise; with buffers made anew for every band it was
5.8 ms).
## Consequences
* The hairline of #182 is gone from the stage (CPU and GPU), Test Movie and every raster export,
for drawings made here and raw shapes opened from Animate files alike.
* Pixels along the shared edges of merged fills change; nothing else does. No golden picture
in the repository had such an edge.
* Edges that are shared but flattened differently (two shapes that only happen to touch, not
cut by the merge) add up to within the flattening tolerance, a tenth of a pixel, instead of
exactly.
* *Not covered:* the vector exports (SVG, HTML canvas, Lottie) write each fill as its own path,
and a viewer that anti-aliases them one over the other shows the same hairline there; fills
of one drawing separated in the stacking order by a line (the merge keeps a drawing's fills
under its lines, so this is rare); a fill meeting a drawing object or another layer.
* *Rejected:* growing each fill under its neighbours (wrong for transparent fills, and it
needs to know which edges are shared); drawing a merged drawing through one coverage pass
with a paint per region (a second rasterizer for both renderers); supersampling (it thins the
hairline, never removes it).
+2 -2
View File
@@ -103,7 +103,7 @@ The **Headless** column at the end of each table says whether `anicraft-cli` and
| Feature | Status | Notes | Headless |
|---|---|---|---|
| Selection | **partial** | Raw shapes, objects, marquee, bend an edge, move a corner ([ADR 0041](adr/0041-selection-tool-on-raw-drawings.md), [ADR 0044](adr/0044-selection-across-layers.md)). A marquee takes the instances and objects it touches, and View › Hide Edges hides the selection's marks ([ADR 0134](adr/0134-outside-parity-batch-zoom-outlines-and-egui-0-37.md)). Missing: a preference for the marquee to take only what it surrounds; the first-use hint about fills and outlines (P-017). |
| Selection | **partial** | Raw shapes, objects, marquee, bend an edge, move a corner ([ADR 0041](adr/0041-selection-tool-on-raw-drawings.md), [ADR 0044](adr/0044-selection-across-layers.md)). A marquee takes the instances and objects it touches, and View › Hide Edges hides the selection's marks ([ADR 0134](adr/0134-outside-parity-batch-zoom-outlines-and-egui-0-37.md)). A preference says whether the marquee takes objects it only touches or only those wholly inside it (Preferences › Stage, `view.select_touching`). Missing: the first-use hint about fills and outlines (P-017). |
| Subselection | **done** | [ADR 0042](adr/0042-subselection-and-merging-everywhere.md), [ADR 0045](adr/0045-raw-points-and-raw-shapes-inside-symbols.md). |
| Free Transform | **partial** | Scale, skew, rotate, the transformation point, a box that turns with the object ([ADR 0111](adr/0111-the-transformation-point-a-turning-box-and-layer-opacity.md)), Envelope ([ADR 0080](adr/0080-drawing-parity-leftovers.md)). Missing: Distort. Open bug: rotation on Windows and FreeBSD ([#479](https://github.com/storytold/anicraft/issues/479)), not reproduced on Windows 10 (P-005). |
| Gradient Transform | **done** | Gradient and bitmap fills, Lock Fill. |
@@ -142,7 +142,7 @@ The **Headless** column at the end of each table says whether `anicraft-cli` and
| Feature | Status | Notes | Headless |
|---|---|---|---|
| Merge drawing: raw strokes and fills that cut and join | **done** | [ADR 0031](adr/0031-merge-drawing.md), [ADR 0041](adr/0041-selection-tool-on-raw-drawings.md), [ADR 0042](adr/0042-subselection-and-merging-everywhere.md), [ADR 0045](adr/0045-raw-points-and-raw-shapes-inside-symbols.md); [drawing](guide/drawing.md). Open bug: a hairline between merged curved fills ([#182](https://github.com/storytold/anicraft/issues/182), P-013). |
| Merge drawing: raw strokes and fills that cut and join | **done** | [ADR 0031](adr/0031-merge-drawing.md), [ADR 0041](adr/0041-selection-tool-on-raw-drawings.md), [ADR 0042](adr/0042-subselection-and-merging-everywhere.md), [ADR 0045](adr/0045-raw-points-and-raw-shapes-inside-symbols.md); [drawing](guide/drawing.md). Fills that share an edge are drawn without a line of the stage between them ([ADR 0138](adr/0138-fills-of-one-merged-drawing-join-without-a-seam.md), [#182](https://github.com/storytold/anicraft/issues/182)). |
| Object drawing | **done** | Edit inside by double-click. Editing without opening is missing ([#181](https://github.com/storytold/anicraft/issues/181)). |
| Groups, nested, edited in place | **done** | [ADR 0073](adr/0073-groups-combine-objects-and-selection-modifiers.md). |
| Break Apart | **done** | |
+6 -4
View File
@@ -55,10 +55,9 @@ the changelog.
| P-011 | Shape tweens morph a raw shape's outline with its fill (outside PR [#238](https://github.com/storytold/anicraft/issues/238)) | Tweens | S | | doc |
| P-012 | Small hardening fixes from outside, in batches as they come (the second, of 2026-11-24, is in the changelog): overflow in `Vec2::length` ([#142](https://github.com/storytold/anicraft/issues/142)), alpha kept by `Rgba::to_hex` ([#233](https://github.com/storytold/anicraft/issues/233)), a test for path numbers past `f32` ([#130](https://github.com/storytold/anicraft/issues/130)), private-use language tags ([#486](https://github.com/storytold/anicraft/issues/486)), a test of SVG link sanitising ([#500](https://github.com/storytold/anicraft/issues/500)) | (robustness) | S each | | several |
| P-009 | Timeline bugs: a click on the playhead acts on every layer ([#195](https://github.com/storytold/anicraft/issues/195), outside PR [#222](https://github.com/storytold/anicraft/issues/222)), several layers selected with Ctrl and Shift ([#512](https://github.com/storytold/anicraft/issues/512)), the layer count over the header icons ([#523](https://github.com/storytold/anicraft/issues/523)), the mask edge drawn in the layer colour ([#429](https://github.com/storytold/anicraft/issues/429)) | Timeline, layers | S each | | timeline |
| P-013 | No hairline between merged curved fills ([#182](https://github.com/storytold/anicraft/issues/182)) | Drawing model | M | | geom |
| P-014 | Pen pressure on every desktop: Linux Wayland (outside PR [#320](https://github.com/storytold/anicraft/issues/320)), reports from tablets ([#290](https://github.com/storytold/anicraft/issues/290)) | Tools | M | a tablet to test with | platform |
| P-015 | Verified by hand on real machines: the Mac checklist of [ADR 0062](adr/0062-test-movie-window-and-macos-document-opening.md), a hybrid-GPU laptop, passes with Narrator, VoiceOver and Orca ([ADR 0064](adr/0064-accessibility-second-pass.md)), launcher icons on Fedora ([#348](https://github.com/storytold/anicraft/issues/348)) | Accessibility, platforms | M | the machines; the person | platform |
| P-016 | The guide tells the truth: "Coming from Animate" still lists shipped features as missing; close the issues the appendix marks delivered (the lead does that) | (docs) | S | | docs |
| P-016 | The guide tells the truth, what is left: every chapter's "not yet" list was checked against the code on 2026-11-27 and "Coming from Animate" no longer lists shipped features as missing; left is closing the issues the appendix marks delivered (the lead does that) | (docs) | S | | docs |
### Next: the parity gaps artists meet every day
@@ -141,6 +140,9 @@ As of 2026-11-24 (46 open):
| PR | What | Id | State | What it still needs, or what happened |
|---|---|---|---|---|
| [#669](https://github.com/storytold/anicraft/issues/669) | No stale pasteboard fragments while stage tiles are replaced | P-004 | **merged** | Merged with its commits, as it is, with the P-013 pull request. |
| [#664](https://github.com/storytold/anicraft/issues/664) | The GPU counts the scratch memory of filtered work still in flight | P-004 | **merged, changed** | Merged with its commits, with the P-013 pull request. It refused every filtered tile in the browser, where a submission can't be waited for; there the allowance isn't kept and filtered layers draw on the GPU as before. |
| [#633](https://github.com/storytold/anicraft/issues/633) | Stage coordinates at tiny zooms, and the fitted zoom kept when the zoom field loses focus | P-012 | **merged** | Merged with its commits, as it is, with the P-013 pull request. |
| [#13](https://github.com/storytold/anicraft/issues/13) | Bound the work of evaluating nested symbols | (done) | **superseded by** | The P-002 change ([ADR 0128](adr/0128-one-work-allowance-and-frames-that-say-what-they-left-out.md)), which took its ideas into the allowance `main` already had: layers, symbol lookups and outline sizes count as work, and a frame that ran out says so. Its commits were not merged: they rewrite what [#497](https://github.com/storytold/anicraft/issues/497) rewrote, and its charge of one unit per library entry would cut honest documents with large libraries. Credited in `AUTHORS.md`. |
| [#39](https://github.com/storytold/anicraft/issues/39) | Text that mixes directions | (P-008, done) | **superseded by** | Its commits are merged in the P-008 pull request, which rebuilds it on the styled-text layout ([ADR 0130](adr/0130-mixed-directions-and-fallback-faces.md)): lines found in reading order and never inside a cluster, and its tests, are kept; levels and reordering come from `craft-text`. Nothing in it is left out. |
| [#40](https://github.com/storytold/anicraft/issues/40) | Letters from a fallback face | (P-008, done) | **superseded by** | Merged and rebuilt with [#39](https://github.com/storytold/anicraft/issues/39) ([ADR 0130](adr/0130-mixed-directions-and-fallback-faces.md)): its family list, the cluster that moves whole with its marks, invisible characters that are never missing and the note about boxes are kept; installed faces outside the list, which it left for later, are searched too. |
@@ -195,7 +197,7 @@ As of 2026-11-24 (46 open):
| [#583](https://github.com/storytold/anicraft/issues/583) | Next and Previous Frame stop at the ends ([#561](https://github.com/storytold/anicraft/issues/561)) | (done) | **superseded by** | Merged with its commit. |
| [#582](https://github.com/storytold/anicraft/issues/582) | A press selects at once and the playhead follows a drag ([#561](https://github.com/storytold/anicraft/issues/561)) | (done) | **superseded by** | Merged with its commit. Left from [#561](https://github.com/storytold/anicraft/issues/561): whether the playhead may stand on an empty cell. |
| [#581](https://github.com/storytold/anicraft/issues/581) | PNG frames and sequences can export transparent ([#536](https://github.com/storytold/anicraft/issues/536)) | (done) | **superseded by** | Merged with its commits, joined with the left-out note of [ADR 0128](adr/0128-one-work-allowance-and-frames-that-say-what-they-left-out.md). Left from [#536](https://github.com/storytold/anicraft/issues/536): a transparent GIF. |
| [#580](https://github.com/storytold/anicraft/issues/580) | The marquee takes the objects it touches ([#522](https://github.com/storytold/anicraft/issues/522)) | (done) | **superseded by** | Merged with its commit. The reference app has a preference for this; ours is always on. |
| [#580](https://github.com/storytold/anicraft/issues/580) | The marquee takes the objects it touches ([#522](https://github.com/storytold/anicraft/issues/522)) | (done) | **superseded by** | Merged with its commit. The reference app has a preference for this; ours came after (Preferences › Stage, `view.select_touching`), on to begin with. |
| [#579](https://github.com/storytold/anicraft/issues/579) | Distribute to Layers ([#517](https://github.com/storytold/anicraft/issues/517)) | (done) | **superseded by** | Merged with its commits. Left in P-021: raw shapes, and Distribute to Keyframes. |
| [#578](https://github.com/storytold/anicraft/issues/578) | Match Size and Space Evenly in Align ([#566](https://github.com/storytold/anicraft/issues/566)) | (done) | **superseded by** | Merged with its commits; it measures outlines as align does, and the Align panel's default height shows the new row. |
| [#577](https://github.com/storytold/anicraft/issues/577) | Each filter in Properties is a card that folds ([#533](https://github.com/storytold/anicraft/issues/533), [#534](https://github.com/storytold/anicraft/issues/534)) | (done) | **superseded by** | Merged with its commit. |
@@ -279,7 +281,7 @@ This integration depends on craft-libs #1962 and still requires hosted parity va
| Architecture | M0 skeleton in place: geom → doc → render → engine → cli → shell, layering enforced by `cargo test` (`src/architecture_tests.rs`: lower layers only, no UI crates below the shell, and the AGENTS.md map must match). |
| Rendering | CPU oracle with analytic AA, non-zero/even-odd, solid + linear/radial gradients (with reflect/repeat, focal points, elliptical radials and linear RGB, ADR 0074), round-join strokes. **A stroke is covered as one outline** (ADR 0110): the stroker builds each run of segments as an outline and unites the loops, so pixels where its pieces used to overlap (round joins and caps, the joints of wide curves, dashes that run together, a line crossing itself) are no longer up to half a pixel too dark, on the CPU and the GPU stage alike; a line with corners, flat or square ends is drawn pixel for pixel as its Convert Lines to Fills fill, a curved or round one within the 0.1 px flattening (not yet: one geometry for both on curves, a per-stroke outline cache, dashes measured along the curve). **Mask clipping**: the display list carries nested clips; a clip is the anti-aliased union of its mask fills (strokes and opacity ignored), intersected with any enclosing clip, computed once per render band; an empty mask hides everything under it. **Soft masks** (ADR 0070): a mask layer's mask type is Shape (coverage), Alpha (its artwork's opacity as drawn: gradients, faded shapes, strokes, bitmaps) or Luminance (brightness × opacity, SVG's coefficients), in the CPU oracle (analytic tests), the GPU stage (parity: mean 0.00006, worst 1 step of 255), SVG export (`<mask>` with `mask-type`), Lottie (alpha and luma track mattes) and the HTML canvas; Layer Properties › Mask type. **Group alpha**: a symbol instance below full opacity is a group in the display list; each render band composites the group's run of ops into its own buffer (nested groups stack) and blends it once at the group's alpha, so overlaps don't show through; SVG export writes `<g opacity>`. **Blend modes** (Animate's 14, on movie clip and button instances): an instance with one is an isolated group that blends at its close with the W3C separable formulas on premultiplied colour (Alpha and Erase keep or clear the backdrop); SVG gets CSS `mix-blend-mode`, Lottie the layer `bm`. **Bitmaps**: `Paint::Bitmap` fills (once or tiled) with bilinear sampling in premultiplied space, colour effects per sample; PNG/JPEG import to stage (a rectangle of the image's size); stored in the document as PNG (base64 in `.anicraft`), decoded once on first use; SVG export embeds each image once as a pattern. **Filters**: a filtered group is drawn on its own (by the same renderer, recursively, so nested filters work) into a buffer over its artwork grown by the filters' reach, filtered (box-blur passes; shadow and glow from the blurred, offset opacity; **bevel and gradient bevel** from the difference of the blurred opacity offset towards and away from the light, **gradient glow** from the glow's intensity, both through a colour ramp whose rest stop is pinned transparent, inner/outer/full and knockout, ADR 0025; colour matrix), and composited back as one image in its group, so alpha and blend apply; clips from inside the symbol apply before filtering and the instance's own clip after. Filters apply in list order and may be switched off (ADR 0091): `evaluate` leaves switched-off ones out, so every renderer and export draws them as absent. **GPU stage, first slice** (M3, ADR 0019; `--features gpu-stage`, off by default): Preferences › Stage › Renderer *GPU (preview)* draws the stage with wgpu compute from the oracle's own prepared fills (tile binning with per-row backdrops on the CPU, exact area coverage and src-over per pixel on the GPU): solid and gradient fills and strokes, non-zero and even-odd; masks, group opacity, blend modes, filters and bitmaps fall back to the CPU per tile, and the status bar says so. Parity with the oracle: max 1/255, mean < 0.0001/255 on the sample, stress and analytic scenes (tests skip without an adapter). 4K with 1,000 shapes: 8.8–9.0 ms vs the CPU's 17.4–17.8 ms. **Second slice** (ADR 0029): on the window's wgpu device the stage tiles are drawn straight into textures egui shows (no readback; a headless device with readback when the window is on OpenGL); **masks** (nested, united artwork), **group opacity** and **all 14 blend modes** on the GPU, same parity (max 1/255, mean ≤ 0.0011/255); 4K: 1,000 shapes in 2.1–2.4 ms, 10k shapes in 10.2 ms as stage tiles, masked scenes 7× the CPU. **Third slice** (ADR 0032): **bitmap fills** (textures uploaded once per image and cached under a 256 MB budget, sampled with the oracle's own bilinear filter, colour effect and repeat rules: byte-identical) and **all seven filters** (each filtered symbol drawn into a layer of its own and filtered by compute passes that run the oracle's resolved steps: max 1/255, mean ≤ 0.007/255) on the GPU; the shaders now build with Direct3D's FXC, so DX12 windows get the GPU stage too (parity suite green on Vulkan and DX12); software adapters are refused (the CPU is faster), the start-up self-test compares with the oracle. **The GPU is the default stage renderer**: theLine truncated
| Timeline | **Frame selection**: click, Shift-click or drag across frames and layers; F5/Shift+F5, F6/F7 and Shift+F6 (keys, icon buttons and right-click menu) act on the whole selection; with no frame selection F5 extends every layer with frames at or after the playhead, and F5/F6/F7 move the playhead on as in Animate (F6/F7 on a keyframe key the next frame; `all_layers`/`advance` headless); drag selected keyframes left or right to move them, and up or down onto other layers (the source keeps empty frames) (with a drop outline; one undo step; keys they land on are replaced, and spans fill the frames left behind); removing or clearing selected frames that hold artwork asks first. **Cut/Copy/Paste Frames** (Ctrl+Alt+X/C/V, and plain Ctrl+X/C/V after clicking the timeline): own clipboard, copies cut exactly at the selection edges (mid-tween state kept), paste inserts like Animate, several layers paste onto the layers below (missing ones are created), fresh element ids, symbols travel with them. **Span length by dragging its end** (resize cursor, live outline with the length in frames and seconds; later frames move with it; a motion tween's keys stretch in proportion, ADR 0083). Side dock tab strips never run under the panel menu (names shrink with an ellipsis, then the strip scrolls). Headless: `layers`/`count` on the frame commands, `timeline.move_keyframes`, `timeline.cut_frames/copy_frames/paste_frames`. Layers (show/lock/outline), **timeline polish** (ADR 0061): a per-layer **onion skin toggle** column (Alt-click solos; left-out layers aren't onion-skinned; Edit Multiple Frames unaffected), the colour square toggles **View as Outlines** in the layer colour **on the stage only** (exports, Test Movie and the player draw the artwork as it is), the **colour chip** opens the layer colour (swatches, hex, More…), **onion frames of the parent timeline** dimmed around a symbol edited in place, **Layer Height** 100/200/300 %, **Layer Properties** (double-click the layer icon; name, show/lock, type, outline colour, outlines, onion, height; one undo step), **Frame View** (Tiny/Small/Normal/Medium/Large, Short rows) with the frame zoom in the timeline's bottom bar (the header fits at the default window size, tested); headless `layer.set_onion/set_color/set_height/set_properties/properties`; XFL `heightMultiplier`. Not yet: folder onion toggles, onion of deeper parent timelines, multi-layer Layer Properties and layer transparency, frame thumbnails (Preview). **Layers by drag and all at once** (M8, from the issue tracker): drag a layer by its name to reorder it or drop it on a folder (a line shows where it lands; folders, masks and guides move whole; one undo step; `layer.move {before | after | into}`), the eye, padlock and outline square above the layer names act on every layer (`all` on the three toggles), and the line between the layer names and the frames drags (150–600 pt, kept in the preferences). Not yet: several selected layers dragged together, dragging a layer onto another scene. Keyframes, blank keyframes, insert/remove frames, classic tweens with **ease presets and custom eases** (ADR 0081: Classic Ease with a strength and Quad, Cubic, Quart, Quint, Sine, Back, Circ, Bounce and Elastic In/Out/In Out; custom eases of up to 64 Bézier points in the Custom Ease window, x kept monotonic, overshoot allowed, keyboard operable, **shape tweens** (morph between any two shapes: segments made cubic, subpaths paired by size and grown from or shrunk to a point when counts differ, segment counts equalized by subdivision, windings matched and start points aligned; amber spans; classic ⇄ shape keeps the easing; **shape hints** (ADR 0023): Modify › Shape › Add Shape Hint (Ctrl+Shift+H) adds lettered markers `a`–`z` that the artist drags onto an edge on the first and last keyframe (rose until placed, amber placed on the first, mint on the last; right-click removes), the morph cuts both outlines at the hinted points and matches the pieces in order by length; `tween.add_hint/move_hint/remove_hint/clear_hints/hints`; not yet: View › Show Shape Hints, hints inside symbols edited in place), auto-key when editing inside a tween, frame labels, symbol nesting: graphics keep step with their timeline (loop, play once, single frame, first frame; set in Properties), movie clips loop their own timeline from when the instance appears (continuous across keyframes holding the same instance), buttons show their Up frame, looping playback. **Onion skin and Edit Multiple Frames** (ADR 0047): onion markers on the frame ruler (drag the start and end brackets; Always Show Markers, Anchor Markers, Onion 2 / Onion 5 / Onion All, also on a right-click on the ruler), frames before and after the playhead tinted in their own colours (theme blue and green, changeable in the onion menu, Reset) and fading with distance, Outlines, Keyframes Only, locked layers left out as in Animate, each layer's onion frames under its own artwork and over tLine truncated
| Drawing | Selection (click, shift-add, marquee, drag-move, arrow nudge; **across layers**, ADR 0044: a selection holds artwork on several visible, unlocked layers, the timeline marks them, Properties shows mixed values), **Free Transform (Q)**: scale from corner/edge handles (Shift proportional, Alt from centre), **skew** by dragging the line between two handles (the opposite edge stays, Alt about the centre; outside PR #176), rotate outside corners (Shift snaps 15°), move; one undo step per drag. Rectangle (corner radius), oval, PolyStar, line (45° snap), hand, zoom. **Pen (P)**: click for corners, drag for smooth handles (Alt breaks them), close on the first point, Enter/Esc/last-point click finishes, Backspace takes back a point; one undo step per path. **Pencil (Shift+Y)**: Smooth (Schneider curve fitting with corner detection), Straighten and Ink modes, smoothing relative to the screen. **Subselection (A)**: anchors and handles on selected shapes, drag points/handles (anchors bring their handles; one undo step per drag), point marquee, double-click an edge to add a point, Delete removes points, right-click Make Smooth/Corner; closed shapes' start point and closing edge edit like any other. **Cut/Copy/Paste in Center/Paste in Place** (the clipboard carries symbols across documents; pasted raw shapes float, selected, until they are deselected, and Paste takes a picture copied in another app as a bitmap, ADR 0108; not yet: vectors copied in other apps). Free Transform: not yet a transformation point you can move (it is the box's centre) or a box that turns with a rotated object. **Rotate 90° CW/CCW, Flip H/V. Align** left/centre/right/top/middle/bottom (Ctrl+Alt+1…6; a single element aligns to the stage) and distribute. Convert to symbol / break apart; arrange; duplicate. Headless: `draw.path`, `draw.freehand`, `path.move_points/add_point/delete_points/convert_point`. **Paint Bucket (K)**: click a fill to recolour it, or inside an outline (one shape or several) to fill the enclosed area; gap size None/Small/Medium/Large closes openings; the fill is traced and curve-fitted into a new shape placed under its lines; open areas say so instead of flooding. **Ink Bottle (S)**: gives the clicked shape the current stroke. Headless: `paint.bucket`, `paint.ink`. Tool options show first in Properties while a drawing tool is active. **Text (T)** (ADR 0012): click to type on the stage, click or double-click text to edit it; font (installed families, plus the embedded Inter), size, colour, under or over the artwork, snap accuracy up to Always); Snap to Pixels; one snap engine for every drawing tool, the Selection tool's moves and Free Transform's handles (point › guide › line › grid › pixel, guides and grid per axis); stage only, never exported, on the CPU and GPU stage. Headless: `view.rulers`, `view.grid_show/grid_snap/grid_set`, `view.guides_show/guides_lock/guides_snap/guides_set`, `view.guide_add/guide_move/guide_delete/guides_clear`, `view.snap_pixels`, `view.aids`, `moving` on `draw.snap`. *Not yet:* units other than px, a movable ruler origin, a symbol's own guides, guides and grid from Animate files, Snap Align and Edit Snapping, snapping while rotating. bold, italic, alignment, letter/line spacing, wrap width; the last style is kept for new text; laid out by `anicraft-text` (`fontdb` discovery, `harfrust` shaping, `skrifa` outlines) and stored as outlines with the source, so rendering never needs the font; Break Apart makes a shape. **Variable-width strokes** (ADR 0018): a stroke's width varies along it through width points (position by arc length, a width on each side as a factor of the stroke width, smooth monotone interpolation); built-in profiles (Uniform, Taper both ends, Taper start, Taper end, Bulge, Pinch) in Properties › Width with a picture of each, and in the drawing tools' options for new strokes; the **Width tool (U)**: hover a stroke to see its width points, drag a handle to widen or narrow (Alt: one side), drag the dot to slide a point, drag anywhere on the stroke to add one, Delete removes; one undo step per drag; rendered by the oracle as trapezoids with outer round joins and cross-section caps, written by SVG and Lottie export as the same filled outlines; shape tweens blend profiles; `.anicraft` keeps them (older files open as uniform). Headless: `stroke.set_profile`, `stroke.set_width_point`, `stroke.delete_width_point`, `stroke.width_at`, `profile` on `element.set_stroke`, the drawing commands and `paint.ink`. Not yet: width data from or to Animate files, saved custom profiles, pressure. **Stroke styles** (ADR 0046): Properties › Style (Solid, Dashed with dash and gap, Dotted with spacing), Cap (None, Round, Square), Join (Miter, Round, Bevel) and Miter limit, also in the drawing tools' options for new strokes; drawn exactly by the oracle (butt and square caps, miters bevelled past the limit, dashes by arc length restarting per subpath, round dots, dashes keeping a widthLine truncated
| Drawing | Selection (click, shift-add, marquee, drag-move, arrow nudge; **across layers**, ADR 0044: a selection holds artwork on several visible, unlocked layers, the timeline marks them, Properties shows mixed values), **Free Transform (Q)**: scale from corner/edge handles (Shift proportional, Alt from centre), **skew** by dragging the line between two handles (the opposite edge stays, Alt about the centre; outside PR #176), rotate outside corners (Shift snaps 15°), move; one undo step per drag. Rectangle (corner radius), oval, PolyStar, line (45° snap), hand, zoom. **Pen (P)**: click for corners, drag for smooth handles (Alt breaks them), close on the first point, Enter/Esc/last-point click finishes, Backspace takes back a point; one undo step per path. **Pencil (Shift+Y)**: Smooth (Schneider curve fitting with corner detection), Straighten and Ink modes, smoothing relative to the screen. **Subselection (A)**: anchors and handles on selected shapes, drag points/handles (anchors bring their handles; one undo step per drag), point marquee, double-click an edge to add a point, Delete removes points, right-click Make Smooth/Corner; closed shapes' start point and closing edge edit like any other. **Cut/Copy/Paste in Center/Paste in Place** (the clipboard carries symbols across documents; pasted raw shapes float, selected, until they are deselected, and Paste takes a picture copied in another app as a bitmap, ADR 0108; not yet: vectors copied in other apps). Free Transform: not yet a transformation point you can move (it is the box's centre) or a box that turns with a rotated object. **Rotate 90° CW/CCW, Flip H/V. Align** left/centre/right/top/middle/bottom (Ctrl+Alt+1…6; a single element aligns to the stage) and distribute. Convert to symbol / break apart; arrange; duplicate. Headless: `draw.path`, `draw.freehand`, `path.move_points/add_point/delete_points/convert_point`. **Paint Bucket (K)**: click a fill to recolour it, or inside an outline (one shape or several) to fill the enclosed area; gap size None/Small/Medium/Large closes openings; the fill is traced and curve-fitted into a new shape placed under its lines; open areas say so instead of flooding. **Ink Bottle (S)**: gives the clicked shape the current stroke. Headless: `paint.bucket`, `paint.ink`. Tool options show first in Properties while a drawing tool is active. **Text (T)** (ADR 0012): click to type on the stage, click or double-click text to edit it; font (installed families, plus the embedded Inter), size, colour, under or over the artwork, snap accuracy up to Always); Snap to Pixels; one snap engine for every drawing tool, the Selection tool's moves and Free Transform's handles (point › guide › line › grid › pixel, guides and grid per axis); stage only, never exported, on the CPU and GPU stage. Headless: `view.rulers`, `view.grid_show/grid_snap/grid_set`, `view.guides_show/guides_lock/guides_snap/guides_set`, `view.guide_add/guide_move/guide_delete/guides_clear`, `view.snap_pixels`, `view.aids`, `moving` on `draw.snap`. *Not yet:* units other than px, a movable ruler origin, a symbol's own guides, guides and grid from Animate files, Snap Align and Edit Snapping, snapping while rotating. bold, italic, alignment, letter/line spacing, wrap width; the last style is kept for new text; laid out by `anicraft-text` (`fontdb` discovery, `harfrust` shaping, `skrifa` outlines) and stored as outlines with the source, so rendering never needs the font; Break Apart makes a shape. **Variable-width strokes** (ADR 0018): a stroke's width varies along it through width points (position by arc length, a width on each side as a factor of the stroke width, smooth monotone interpolation); built-in profiles (Uniform, Taper both ends, Taper start, Taper end, Bulge, Pinch) in Properties › Width with a picture of each, and in the drawing tools' options for new strokes; the **Width tool (U)**: hover a stroke to see its width points, drag a handle to widen or narrow (Alt: one side), drag the dot to slide a point, drag anywhere on the stroke to add one, Delete removes; one undo step per drag; rendered by the oracle as trapezoids with outer round joins and cross-section caps, written by SVG and Lottie export as the same filled outlines; shape tweens blend profiles; `.anicraft` keeps them (older files open as uniform). Headless: `stroke.set_profile`, `stroke.set_width_point`, `stroke.delete_width_point`, `stroke.width_at`, `profile` on `element.set_stroke`, the drawing commands and `paint.ink`. Not yet: width data from or to Animate files, saved custom profiles, pressure. **Stroke styles** (ADR 0046): Properties › Style (Solid, Dashed with dash and gap, Dotted with spacing), Cap (None, Round, Square), Join (Miter, Round, Bevel) and Miter limit, also in the drawing tools' options for new strokes; drawn exactly by the oracle (butt and square caps, miters bevelled past the limit, dashes by arc length restarting per subpath, round dots, dashes keeping a widthLine truncated
| Plug-ins | **WebAssembly plug-ins** (ADR 0017, `docs/plugins.md`): sandboxed modules run by `wasmi` with no imports but the AniCraft ABI (`anicraft.call`/`anicraft.response`: JSON requests that run registry commands, read a compact document view or the active layer's elements, and log); fuel (10⁹ instructions), memory (256 MiB), wall-clock (5 s), request, size and log limits, a fresh instance per run; file, plug-in, undo and clipboard commands refused. `plugin.install/list/run/remove/reload`; a run is atomic and one undo step named after the plug-in. App: **Commands** menu (Plug-ins, Install, Manage, Reload), palette entries, a dialog generated from the manifest's parameters with a live preview; plug-ins load from `<settings>/plugins` or `ANICRAFT_PLUGINS`; CLI `--plugins`. Samples in Rust (Star Field, Jitter Selection, guest SDK) in `examples/plugins`. Frame scripts: see Interactivity. **Exporter and ease plug-ins** (ADR 0088): `kind: "exporter"` declares a format (name, extension, options) and gets evaluated frames (`movie`, `frame`: the flattened display list, never the document), returning the file's bytes from `ac_export` (64 MiB cap, 5·10¹⁰ instructions, 10 min); File › Export lists it with an Export window (options, frames, file, progress bar and Cancel on a worker thread); `file.export_plugin`, `file.export_formats`, `anicraft-cli export --format <id>` and `formats`. `kind: "ease"` declares named eases, `ac_ease(i, t)` sampled into 257 values at load (NaN, unbounded or end-missing eases refused); `Easing::Sampled` keeps the table in the document, so it plays the same without the plug-in; the ease menus list them under Plug-in eases; `{plugin, ease}` easing params. Samples: Plain Text Frames and Stepped Eases, built and run in CI. Not yet: plug-in formats in Publish, bitmaps' pixels and sounds for exporters, ease plug-ins with parameters, background runs of command plug-ins, a binary document view. |
| Interactivity | **Frame actions, frame scripts and Test Movie, first slice** (ADR 0024): a typed timeline action IR (`anicraft-actions`: stop, play, go to a frame or label in a scene, next/previous frame and scene, trace, set x/y/alpha/visible/rotation/scale, instance-name target paths) on keyframes and on button and movie clip instances (click, press, release, over, out); a pure, deterministic, budgeted player in `anicraft-doc` (`step(doc, &state, &events)`; movie clip playheads, button Up/Over/Down states with Hit-frame hit tests, script-set properties) drawn by `evaluate_player`, while `evaluate` and exports stay script-free. **Actions panel** (F9: structured lists, targets/labels/scenes picked from the document; movie clip timelines too), instance name and events in Properties, an "a" on keyframes with actions. **Frame scripts** on the plug-in host (`kind: "frame-script"`, entry points, `player`/`action` ops, 20 M instructions per frame shared, no document access). **Test Movie** (Control › Test Movie, Ctrl+Enter): the player at the document frame rate in its own window with the pointer, restart/pause/step and an Output panel. **A window of its own on the desktop** (ADR 0062): sized to the stage at 100 % (smaller to fit the screen), titled with the document, back where it was last (not on Wayland, where the desktop places windows), with the keyboard when it opens; Esc or Ctrl+W (⌘W) closes it, Ctrl+Enter restarts it in place, and the editor's Ctrl/Alt shortcuts work from it; floating inside the editor in the web build, where the system can't open windows (it says so), or by choice in Preferences › Test Movie. Not yet: full screen, zoom in the movie window, remembering its size. Headless: `actions.set/clear/list`, `instance.set_name`, `control.test_movie` (timed pointer events, returns output and state). **HTML canvas export** (ADR 0028, `file.export_html`, File › Export › Export HTML Canvas…): one self-contained page (data, player and drawing code inline; images and sounds embedded) that plays in any browser with canvas 2D; every used timeline baked frame by frame (tweens of every kind exact, identical paths, paints and frames stored once), movie clips, buttons with Hit areas and every action run by `player.js`, a port of the Rust player checked against it step by step in Boa (state, output and display list); masks and fading/blending groups on offscreen layers; **filters and Subtract/Invert in the page** (ADR 0072: `filters.js`, a port of the renderer's filters run over the group's pixels on a layer that reaches past the canvas by the filters' reach, Subtract and Invert composited per pixel, results kept while the group is unchanged; equal to the oracle's pixels within 9.3e-4 in Boa; 3.4 ms a frame for the demo's filters at 1080p while they change); Web Audio for Event/Start/Stop/Stream sounds; bitmap tints, 9-slice scaling and plug-in frame scripts reported. Not yet: 9-slice in the page, keeping a moving filtered group's pixels, filters off the main thread. **Kept frame scripts** (ADR 0013 tier 1): scripts written in another language (an Animate document's ActionScript) kept verbatim on keyframes with their language, symbol linkage classes and the document class; the Actions panel's **Script** view (monospace editor with line numbers, language, live and undoable), the same "a" marker, Class rows in Properties; `script.set/clear/list/set_class`; **ActionScript timeline subset runs** (ADR 0013 tier 2): a hand-written, bounded lexer and parser (`anicraft_actions::as3`) lower stop/play/go to/next and previous frame and scene on instance-name paths, mouse listeners (click, down, up, roll over and out; named or inline functions, `currentTarget`), `trace` and property settings to the action IR, compiled once per script; anything else is reported with line and column and the script doesn't run (never half-run), `navigateToURL` and the like are ignored and noted; the player keeps listeners per instance, Test Movie's Output says which scripts run and which don't and why, the Script view lists problems in place, the XFL report and `script.list/check` say what runs, and the HTML page runs the same steps (`player.js` checked against the Rust player). **ActionScript small logic** (ADR 0052): scripts compile to a small typed script IR evaluated by the player with fuel (100,000 per script or listener call, 1,000,000 per step; an endless loop or a run-time error stops its script with an Output line and the movie plays on): typed variables (Number, int, uint, Boolean, String, untyped) kept per timeline instance across its frame scripts, expressions as ECMA-262 has them, `if`/`else`, `for`/`while`/`do`, functions with parameters, results and recursion, called from any frame of the same timeline (a timeline-level link step; names that aren't there keep the script from running, said in place), property reads of instances and timelines (`x`, `y`, `alpha`, `visible`, `rotation`, `scaleX/Y`, `currentFrame`, `tLine truncated
| Headless | CLI: info, render, render-seq, **gif**, **apng**, **webp**, commands, exec, run, serve (JSON-lines). **MCP server** (`anicraft-cli mcp`, `docs/mcp.md`): stdio JSON-RPC, protocol 2025-06-18 (and 2025-03-26, 2024-11-05); five tools over the command registry (list, run, run a script, describe the document, render a frame as a PNG picture); confirmation tiers and undo apply as in the app. **Live control** (ADR 0104, `docs/control-protocol.md`): `anicraft --control <port>` and `anicraft-cli mcp --bridge <port>` run the same tools on the open window, on this computer only, with a per-run token in `control.json`. **Automation roots** (ADR 0124, AGENTS.md rule 18): `mcp` refuses to start without `--automation-read-root` and `--automation-write-root`; an assistant's commands read inside the read roots and write inside the write root only, checked in the engine (`engine::access`: given paths before the command runs, every `vfs` call, ffmpeg, XFL folders and the plug-in registry) on the resolved path (`..`, links, junctions, letter case), with errors that name the root; the bridge carries the roots and the window applies them per call (control protocol 2); `serve` takes them optionally (not yet: roots saved in the app's preferences as a cap on any bridge, a shared craft-libs helper, environment variables, file handles held open against a swapped link). |