Commit Graph
509 Commits
Author SHA1 Message Date
Tanish Manku 5c4b8594b3 chore: merge main into m3/stroke-coverage 2026-11-18 00:34:53 -07:00
Tanish Manku 28fcfd23c6 fix(render): a stroke's coverage is that of one outline, not of overlapping pieces (M3)
The stroker builds each run of segments as its own outline (inner edges cut where they
cross, through the bend's point where they can't) and unites the loops, so the
renderers' sum of signed areas is the stroke's true coverage: no pixel is darker where
pieces overlapped (it was up to about half a pixel at round joins, caps and the joints
of wide curves). The GPU stage draws the oracle's polygons, so it follows.

Fourteen corpus goldens change, all at stroke edges (lighter; the dark knots at
corners go). Measured, median of 80 renders, before -> after: 2,000 stroked shapes at
1080p 9.3 -> 9.0 ms; the demo 2.5 -> 2.6 ms; 300 self-crossing scribbles at 720p
5.9 -> 6.4 ms; edges handed to the rasterizers down 3 to 4 times.
2026-11-17 23:33:55 -07:00
Tanish Manku 0522c787f6 feat(geom): unions of flattened polygons on an integer grid (M3)
anicraft_geom::polygons::union turns loops that overlap or fold over themselves into
the loops of the area they cover, each point inside exactly one, with i_overlay
(MIT OR Apache-2.0). On clean outlines it costs about 60 ns an edge.
2026-11-17 23:33:55 -07:00
Tanish Manku 9d7c925bf3 test: accessibility sweep, snapping and layer properties expectations for the transformation point and layer opacity; the command reference (M1) 2026-11-17 23:33:06 -07:00
Tanish Manku 6c787dd2df feat(engine): modify.transformation_point, layer.set_opacity, and transforms about an instance's point (M1) 2026-11-17 23:33:05 -07:00
Tanish Manku c23fa96ccd feat(render): layer opacity in the HTML canvas export, with CPU pixel and GPU parity tests (M1) 2026-11-17 23:32:53 -07:00
Tanish Manku 20ac637cc6 feat(doc): an instance's transformation point in tweens, and layer opacity as a fade group (M1) 2026-11-17 23:32:53 -07:00
Tanish Manku bd3fb93138 chore: merge main (shape commands, issue requests) into the editing issue fixes (M1)
Pasting keeps its float parameter beside the transform-origin parameters; the stage keeps the
resize tracking and the picker's eyedropper.
2026-11-17 22:46:56 -07:00
Tanish Manku fa39a53474 test(engine): as_chunks for constant-size chunks, as the newer clippy asks (M1) 2026-11-17 21:51:32 -07:00
Tanish Manku 0566b715b9 chore: merge main into the editing issue batch (M1)
# Conflicts:
#	CHANGELOG.md
#	docs/guide/drawing.md
#	docs/roadmap.md
2026-11-17 21:50:44 -07:00
Tanish Manku 4563afe840 feat(engine): transformation-origin modes for several selected objects (M1)
modify.transform_origin sets or cycles the mode (tool state); modify.transform
takes origin: selection | registration | center, and Rotate 90 and Flip follow
the mode. An object is one element or the selected pieces of one raw drawing;
its centre is the centre of its own box carried by its transform, so a drag
sent as thirty small changes ends where one transform would (tested).
2026-11-17 21:21:29 -07:00
Tanish Manku 04f3fa1981 feat(engine): Convert Lines to Fills, Expand Fill, Soften Fill Edges and paint.sample (M1)
modify.lines_to_fills, modify.expand_fill, modify.soften_fill_edges on the
selection of every layer, in keyframe space and stored back in the shape's own;
raw results merge with the drawing again (ADR 0031), objects stay objects.
paint.sample is the colour the CPU renderer draws at a point.

Measured against the union of the stroker's polygons at 2400 %: the fills'
area is within a pixel of the lines' for caps, joins, dashes, dots, width
profiles, tight curves and mirrored, skewed shapes (0.00 to 0.98 px on 200 to
10,000 px of line).
2026-11-17 21:21:28 -07:00
Tanish Manku c56bd9b61e fix(render): round joins on gentle bends no longer sweep the long way round when zoomed far in (M1)
Zoomed in on a wide dashed or profiled curve (from about 2000 %), the direction
of a join's gap, the difference of two nearly equal unit vectors, was noisier
than the join's sweep, and the join became a whole disc. The gap's middle is now
only consulted where the path nearly turns back; elsewhere the short way between
the two normals is the outside of the bend. Found while checking Convert Lines
to Fills against the stroker's polygons at 2400 %.
2026-11-17 21:21:28 -07:00
Tanish Manku cba20e2107 feat(geom): strokes as exact outlines and fills offset by a distance (M1)
anicraft_geom::outline: ribbons between cross-sections with Hermite offset
curves (0.01 units), the renderer's joins, caps, dashes and width functions,
united by the planar map at a scale where its snap distance is far below a
pixel; offset() and soften() are the boundary's band added or taken away.
planar: a vertex lookup at the edge of i64 no longer overflows.
2026-11-17 21:21:28 -07:00
Tanish Manku 448c7aefbb test(gpu): the gate test's control run waits until its detector has seen the race (M1)
The run without the gate only proves the detector works, but it had 300 ms to
see an overlap, and on CI's Linux runner (busy with the software GPU tests) its
threads sometimes had not run by then: it failed twice in a row on this branch.
It now goes on until it has seen one, for at most 30 s.
2026-11-17 21:11:44 -07:00
Tanish Manku 8b213bc76b test(gpu): the submit gate's control run gets a few tries on busy runners (M8)
Without the gate the detector must see the race, but on a two-core runner the workers and the
detector may not overlap in one 300 ms run (it failed once on the Linux gate). The gated run
still has to hold in every run.
2026-11-17 20:46:51 -07:00
Tanish Manku 6c1d1459d2 chore: merge main into the editing issue batch (M1)
# Conflicts:
#	CHANGELOG.md
2026-11-17 20:15:36 -07:00
Tanish Manku 199d7af539 docs: ADR 0108, the guide, changelog and roadmap for the editing issue batch (M1)
Floating paste, pictures from the system clipboard, refused merges and the
Fill/Stroke memory are recorded in ADR 0108. The command reference is
regenerated; clippy findings in the new tests are fixed.
2026-11-17 20:15:27 -07:00
Tanish Manku 02dd68c445 fix(geom): a dragged edge bends into an even arc wherever it is grabbed (M1)
The Selection tool gave each handle of the dragged segment its own least move,
so an edge grabbed off-centre bulged beside the grab. Both handles now move
alike (d / 3t(1-t)), which still carries the grabbed point: one even arc
between the ends, as in Animate. Near an end the move is bounded.

Fixes #186
2026-11-17 20:04:17 -07:00
Tanish Manku 01348ae851 chore: merge main (outside UI batch, start-up fixes) into issue requests (M8) 2026-11-17 20:00:14 -07:00
Tanish Manku cd56fa177f test(engine): Break Apart on an image and twice on text; a clear message when nothing is left (M1)
Both reports came from 0.2.1 and were fixed by b5fbdac (drawing objects break
apart into raw shapes): an imported image becomes a raw shape with its bitmap
fill, and a second Break Apart on text turns the outlines into raw shapes.
These tests keep it so. A further Break Apart on raw shapes now says they are
raw shapes already.

Fixes #341
Fixes #299
2026-11-17 19:58:21 -07:00
Tanish Manku c063cf67e2 fix(geom): a merge whose map is not planar is refused, so brush strokes no longer vanish (M1)
Where a new brush stroke leaves a crossing almost along an older outline,
snapping could make the two cross again with no vertex there. The planar map
then had faces that were not the drawing's regions: a fill's inside read as
outside, and the merge dropped it, sometimes the whole drawing. The merge now
checks Euler's formula on each connected part of its map and declines when it
fails; the engine keeps the new stroke whole on top, as it does when a merge is
too large, and nothing drawn is lost.

Measured on 400 seeded scenarios of seven crossing strokes: 4 lost most or all
of the drawing before (one lost every stroke), none after.

Fixes #308
2026-11-17 19:56:56 -07:00
Tanish Manku 490da4908b fix(properties): Fill and Stroke turn back on as they were, and Fill on a raw outline fills it (M1)
* The Fill checkbox refilled a shape with white. Turning a fill or a stroke off
  now remembers it for the session (element.set_fill / set_stroke {on}), so on
  again brings back its colour, gradient, bitmap or line; with nothing to
  remember it takes the tool's.
* With only a raw outline selected (double-click on it), Fill put a fill with
  no area on each side. It now refills the fill the outline surrounds, or
  fills the area it closes off as the Paint Bucket does, and says what to do
  when the lines close off nothing.
* The Stroke row has a checkbox like Fill, and the width stops at a hairline
  (0.1) instead of removing the stroke at 0.

Fixes #291
Fixes #292
Fixes #393
2026-11-17 19:37:04 -07:00
Tanish Manku 895b842624 fix(engine): pasted raw artwork floats, selected, until it is deselected (M1)
Paste in Center and Paste in Place merged raw shapes into the drawing at once,
so a copy pasted over its original joined it before it could be dragged away.
The editor now pastes with float: the raw shapes stay whole and selected on
top, and go into the drawing when the selection lets go of them (or when they
are dropped after a move), as in Animate. The merge belongs to the step around
it, so undoing the paste restores the drawing from before it. Scripts that
paste without float still merge at once.

Fixes #391
2026-11-17 19:30:28 -07:00
Tanish Manku a95c51ec53 fix(timeline): F6 and F7 over selected frames key every frame of the range (M1)
With frames 3..5 selected only frame 3 became a keyframe: the commands never
read the count the editor sends. Each frame of the range now becomes a keyframe
(F6) or a blank keyframe (F7) on every selected layer, in one undo step.
Keyframes already inside an F7 range keep their drawings.

Fixes #272
2026-11-17 19:23:10 -07:00
Tanish Manku 008cdd1b3e chore: merge main into fix/issues-start-files 2026-11-17 19:13:25 -07:00
Tanish Manku 968946ea0b chore: merge main (outside features batch: skew) into the outside UI batch (M8) 2026-11-17 18:30:16 -07:00
Tanish Manku b805c38ac8 test(gpu): the gate test's control run can't miss the race on a busy machine (M8) 2026-11-17 18:13:20 -07:00
Tanish Manku 3f214d7ccd fix(control): close a refused connection gracefully so the client reads the reply (M8)
Closing a socket with unread input resets the connection, and on macOS the reset can discard
the refusal before the client reads it (the oversized-line test failed on the macOS gate). The
port now stops writing, drains what the client is still sending (bounded: 8 MiB, 2 s), then
closes.
2026-11-17 17:52:50 -07:00
Tanish Manku 95273a0909 test(gpu): the gate's tests wait on what happened, not on the clock (M8)
On the macOS and Windows runners a helper thread had not started its
submission when the test closed the gate 20 ms later. The tests now wait for
the state they are about (a channel, the gate's own counts) and keep only the
lower time bounds, which hold on any machine.
2026-11-17 17:43:16 -07:00
Tanish Manku e08b01fa91 feat(engine): layer.move, and show, lock or outline every layer (#407, #422) (M8)
layer.move {layer?, before | after | into} puts a layer anywhere in the stack in one undo step; a folder, mask or guide moves with everything in it; nesting past the limit, a folder into itself and the camera are refused. all: true (and on) on layer.toggle_visible/lock/outline act on every layer but the camera.
2026-11-17 17:37:10 -07:00
Tanish Manku cb31b3bf49 Merge origin/main into the outside pull request batch (M8)
# Conflicts:
#	AUTHORS.md
#	CHANGELOG.md
#	crates/engine/src/merge_tests.rs
#	src/panels.rs
2026-11-17 17:30:37 -07:00
Tanish Manku ef3fc8b2e0 chore: merge main (outside core batch) into the outside features batch (M8) 2026-11-17 17:11:07 -07:00
Tanish Manku 8dc06befea fix(desktop): an existing icon cache no longer hides the icons Add to Applications Menu writes (M8)
GTK trusts an icon-theme.cache that is no older than its theme folder, and
adding icons to the size folders below doesn't change that folder's time. So
after another installer made a cache in ~/.local/share/icons/hicolor, the
icons desktop.integrate wrote were never found and the menu and dock showed a
generic icon (the app-side half of #348; the launcher's own installs are
storytold/craft-launcher#412). The refresh now brings the theme folder's time
forward and rebuilds the cache with gtk-update-icon-cache where installed,
only when a cache is there: none is made where there was none.
2026-11-17 16:53:17 -07:00
Tanish Manku c81de6d649 fix(gpu): submit stage work on the window's device only inside a frame (M8)
The stage renderer shares the window's device and submitted its work from the
render service's threads at any time. A window reconfigures its surface when
it opens and when it is resized, and wgpu fails that when another thread
submits meanwhile: 'Surface::configure: Failed to wait for GPU to come idle
before reconfiguring the Surface'. In 0.2.1 that error was a panic, so
AniCraft closed at start-up or on a resize (#264, #309, and with them the
'won't open' reports #421 #412 #313 #286 #285 #268 #164); since ADR 0092 it
is survived, at the cost of a skipped frame, an autosave and a status line
blaming the graphics driver.

A SubmitGate (crates/gpu) is open while the window's thread runs the app's
frame and closed otherwise, also around windows drawn inside the frame (Test
Movie, floating panels). Work waits for it (asking for a frame), at most
250 ms; the renderer's starting self-test goes through it too.

Measured on Windows 10, RTX 5090, Vulkan, --screenshot starts: the error in
3 of 20 starts before, 0 of 20 after; 2.81 s and 2.80 s per run.
2026-11-17 16:48:36 -07:00
Tanish Manku b0fecda353 fix(xfl): open .fla files whose end record overstates the directory size (M8)
Flash CS5 to Animate write the zip end record with a central directory size
54 bytes too large (the mimetype entry's record) whenever mimetype isn't the
first entry. The shared reader refused those as damaged ('the central
directory is outside the archive'): most real .fla files (#356, #385).

The size is corrected in a copy when the directory holds exactly the entries
counted and ends where the record begins; the shared reader then checks the
copy as it checks any archive. To be dropped when the pinned craft-xfl has
storytold/craft-libs#1986.
2026-11-17 16:33:53 -07:00
Tanish Manku 76942283c2 chore: merge main into fix/outside-batch-core 2026-11-17 16:26:38 -07:00
Tanish Manku 68898eb549 Merge origin/main into the outside pull request batch (M8)
# Conflicts:
#	CHANGELOG.md
2026-11-17 16:02:56 -07:00
Tanish Manku da82dc71ea Merge origin/main into the outside pull request batch (M8)
# Conflicts:
#	CHANGELOG.md
2026-11-17 15:18:08 -07:00
Tanish Manku c2472cd639 chore: merge main (styled text, mixed armatures) into filter tracks (M5)
Text keeps its filters next to its styled runs. In HTML export, static text in several colours
with filters is one item of pieces (pp), so the pieces share one filtered group as evaluate
draws them; the page's player draws such items piece by piece.
2026-11-17 14:55:39 -07:00
Tanish Manku b9b5c998c9 chore: merge main (styled text) into the outside batch (M8)
# Conflicts:
#	CHANGELOG.md
#	src/main.rs
2026-11-17 14:47:15 -07:00
Tanish Manku b5f3e5f0a8 chore: merge main into m7/mixed-armatures 2026-11-17 14:13:32 -07:00
Tanish Manku 2fb798f12c fix(control): leave the control port and its getrandom out of wasm32 builds (M8) 2026-11-17 13:59:24 -07:00
Tanish Manku 0c3ceaff8f fix(engine): only raw stroke pieces keep a raw fill bare on a stroke change (M8) 2026-11-17 13:51:07 -07:00
Tanish Manku 34d94154a0 fix(control): free the port with the window, drop silent connections, exclusive token file, portable installs (M8) 2026-11-17 13:46:04 -07:00
Tanish Manku 4e421cf12b Merge outside PR #350: fix(engine): put a group's registration at the centre of its artwork (M8)
# Conflicts:
#	CHANGELOG.md
2026-11-17 13:37:09 -07:00
Tanish Manku b8a46c1e9e Merge outside PR #364: fix(engine): keep the stage picture in the edited scene (M8) 2026-11-17 13:36:49 -07:00
Tanish Manku 1331de2caa fix(cli): derive subcommand help from the usage text; bounds-checked lexer slice; credits (M8)
Fix-ups on the outside PRs merged in this batch:
* #217: subcommand_usage reads the entries out of USAGE instead of keeping a
  second copy, so export, formats and guide search are covered and the two
  cannot drift apart.
* #143: the surrogate-pair lookahead slices with get(), not an index.
* #145 (declined, the reader is craft-xml now): pin that signed numeric
  character references stay text.
* AUTHORS.md and CHANGELOG.md credit the contributors.
2026-11-17 13:36:47 -07:00
Tanish Manku 69ea0098de Merge outside PR #379: Fix scene breadcrumb navigation and improve scene selector UX (M8) 2026-11-17 13:36:21 -07:00
Tanish Manku ad558b6000 Merge outside PR #409: fix(engine): raw drawings align, distribute and turn as one (M8) 2026-11-17 13:36:16 -07:00