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.
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.
Expand Fill and Soften Fill Edges ask for a distance, direction and steps and
remember them; the Modify › Shape items are enabled by what the selection has.
While a colour picker popup is open the stage is its eyedropper: a chip shows
the colour under the pointer, a click gives it to the picker, Esc closes it.
Free Transform sends the transformation origin with turns, scales and skews,
marks each object's own point, and Properties shows Transform about.
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).
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).
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 %.
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.
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.
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.
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.
Their two changes (symbol instance opacity and foreground masks in selection
occlusion) were written against the pass main has since rewritten for speed.
Main's tree is kept: the first already holds there, the second is the previous
commit.
Masked artwork hid nothing, so the stipple of a selection under it showed
through even where the artwork covers it. The idea is from the follow-up
commits of outside PR #404 (Untoldent); main's faster pass works on row spans,
so it is done there: the spans a mask does not show are set aside, the rest go
behind the artwork, with no path booleans, and a mask is outlined once a frame.
Soft masks still hide nothing. The PR's other follow-up (a symbol instance
below full opacity hides nothing) already holds on main: such an instance is a
group, and grouped artwork is never an occluder.
Measured (selection_overlay_cost, 720 selected raw pieces): 6.24 ms a frame,
as before (6.50 ms when the pass was rewritten); the same drawing under an
opaque sheet behind a 48-shape mask: 6.28 ms.
Whole percentages show without a decimal, and a mixed scale is one faint mark with the
explanation on hover, so the row no longer wraps under its label at the dock's default width.
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
Paste only knew AniCraft's own clipboard, so a picture copied in Paint.NET or
Aseprite, or a screenshot, gave 'the clipboard is empty', and Ctrl+V did nothing
at all: egui-winit turns that key into a paste event only when the clipboard
holds text. Paste (menu, context menu and Ctrl/Cmd+V) now places the system
clipboard's picture as a bitmap in the middle of the view, in the Library too,
when it is newer than what AniCraft copied (its own Copy leaves a text note on
the system clipboard). The swallowed key is recognised by its release. Reading
the clipboard is platform code and uses arboard, the library eframe already
uses for text, so no crate is added. Desktop only; vectors from other apps are
not read yet.
Fixes#263
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#341Fixes#299
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
Rotation was there (drag just outside a corner) but the pointer showed the
system's shortcut arrow, so nobody found it. No desktop has a rotate cursor, so
the app hides the system one there and draws a curved double arrow bent around
the box, also while turning.
Fixes#194
A double-click on a raw fill selects it with its outline (since #92), but egui
only counts two clicks up to 0.3 s apart, measured in frames: a relaxed
double-click, or a slow frame after the first click, made it two clicks. The
app now allows the half second Windows and macOS do.
Fixes#192
* 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#291Fixes#292Fixes#393
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
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
Moving keyframes works as in Animate (click to select, then drag), but nothing
said so, and a press on the left third of a keyframe cell grabbed the span-end
handle of the span before it instead. The hand cursor now shows over selected
frames that hold keyframes (closed while they move, the copy cursor with Alt),
a drag that starts on an unselected keyframe says how to move one, and the
span-end handle lies inside the span's last frame.
Fixes#344
The pan is measured from the canvas centre, so a panel that grew or shrank moved
the artwork. A view the artist chose now takes up the centre's move; a view still
as Fit in Window left it goes on fitting. Idea from outside PR #424 (Call4han),
done for every canvas change rather than only while a dock edge is dragged.
Fixes#423