A corner in one subpath gave the stroke's join to the lines of a curve
in another subpath that met at the same point, so a miter could be
drawn there instead of a round join. The corners are now kept per
subpath and each subpath of the outline reads only its own.
Test: a curve's outline is the same with and without a second subpath
that has a corner at the curve's start.
Since #9972 a thin stroke along a curve is drawn as lines, and where two
of those lines met at a sharp angle the stroke's own join was drawn
there. Along smooth anchors that sit close together after a bend, or a
curve that bends tightly, the lines turn sharply, so a miter join drew a
spike past the stroke and the smooth curve showed sharp corners on the
canvas. The document's anchors are unchanged; only the drawing was
wrong.
The stroke's join is now drawn only at the path's own corners, where
two segments meet with tangents that are not in line. Where the lines a
curve is drawn with turn sharply they meet with a round join, as the
stroke along the curve itself is round there.
Tests: a bend followed by smooth anchors 0.1 and 1 apart keeps every
outline point within the stroke's width of the curve and covers it;
with long handles the outline matches the curve's own outline away
from its edge; 200 random cubics with a miter join keep their outline
within the stroke's width of the curve.
A curve drawn as lines took its line ends from the curve's bending alone.
Where a curve runs out and back twice along almost one line, its two turns
hold almost no bending, so a thin stroke drew it with one step in two
halves: each half held a whole turn, the two halves' gaps canceled, and
the band ran straight from start to end without either turn. A cubic from
(0, 0) out to x = 28.87 and back to x = -28.87 drew only around x = 0.
Each step is now checked against its curve: where the curve lies more
than twice the chord allowance from the step's line, to either side or
past its ends, the step count doubles, up to the curve's equal steps.
Wide strokes draw their long curves the same way and get the same check.
A radial or mirror repeat with an effect of its own, such as a drop shadow,
takes its bounds from the object-effects branch, which falls back to
`own_box`. `own_box` measured the placed steps of a spine-aligned blend but
not the rotated or reflected copies of a repeat, so moving such a repeat left
the copies' geometry effects outside the redrawn area. `own_box` now unions
a repeat's placed copies as #9936 does in `cull_bounds_in`.
`placed_live_effect_bounds` now looks for effects below the node only: the
node's own effects run on the placed whole and its callers measure them, so a
repeat or blend whose only effect is its own no longer expands its copies or
steps to measure them.
Each line end of a curve drawn as lines moved out by the curve's whole gap
from the chords beside it, including the part along the chord. Where a
curve runs out and back along almost one line, that part points along the
curve, so the end moved past the turn: a cubic from (0, 0) out to x = 75
and back drew its band out to x = 112.5. The ends now move only across
their chords.
Strokes narrower than four raster tolerances had their outline fitted and
flattened at a tolerance as fine as 1/16 of the raster tolerance, so each
side of a thin curve took about four times the lines a wider stroke takes,
and every frame drew them all. A plain thin stroke (no dashes, no width
profile) along a path with curves is now drawn as lines first, within a
sixth of its width of the curve, and each side of each line is offset by
exactly half the width. The band keeps its width, the outline takes one
line per side for each line of the path. Where two lines meet at a small
angle both sides go to where their offsets cross; sharper corners get the
stroke's join, open ends its caps, and a closed path keeps its hole. Dashed
and profiled thin strokes, and thin strokes along straight paths, are
unchanged.
On 200 cubic curves about 100 device pixels across, a 0.5 px stroke's
outline goes from 15,559 lines to 7,514 (4,288 before #3273).
A Mirror Repeat on a slanted axis reflects its copy before the source's
geometry effects run, so a Transform effect on the copy painted outside
the move and Undo damage region, the same fault #9169 fixes for Radial
Repeat. Mirror repeats now take the same measured bounds, with a test
that fails without the change.
Where no background worker starts (and on the web), schedule makes the
bitmap on the drawing thread. A panic there left the bitmap pending, so
wait_idle, which has no time limit, could wait for it forever. That path
now does what the worker does after a panic: it marks the bitmap failed
and stops it being pending, then lets the panic go on to the caller.
The deb, rpm and tar.gz packages install
share/thumbnailers/ai.storyteller.vectorcraft.thumbnailer for
application/x-vectorcraft and application/x-vectorcraft-template. It runs
the new `vectorcraft-cli thumbnail --size N IN OUT`, which opens the
document as the app does and writes an 8-bit RGBA PNG of the first
artboard, N pixels (1 to 1024, default 256) on its longer side.
A file larger than 256 MiB, one that can't be opened, a document that
shows nothing, or a run longer than 20 seconds writes no PNG and exits
non-zero, so the file manager keeps the file's icon. The Nightly deb and
rpm leave the entry out, as they leave out the MIME package.
The render moves into vectorcraft_render::encode::first_artboard, which
the embedded native preview also uses.
A layer whose Preview is off draws a placed document in it as the crossed
box, and effects that change geometry reshape that box. Two cull-bounds
paths measured such a sublayer in the mode around it instead:
- A group with effects of its own (a drop shadow, for example) is measured
by fx::cull_bounds, which did not enter each layer's own mode. The group
was culled where the sublayer's moved crossed box was in view. Each layer
in that walk is now measured in the mode its Layer Options give it.
- A group's cached bounds were keyed only on whether placed documents are
crossed. Turning Show Images in Outline Mode on or off changes a
Preview-off sublayer's mode without changing that, so the group kept its
old bounds. Every object other than a path is now keyed on the full
layer mode.
A geometry effect is given the object's box as its reference, for
example the center a Transform effect scales and rotates about. Drawing,
the preview bounds, Expand Appearance's first step, shape art, the
outline check of the .ai reader and a stroke's effects before a Transform
that makes the stroke a path of its own measured that box with kurbo's
bounding_box, which counts only segments. A lone anchor was left out, and
a path of one anchor measured a box at the origin, so it scaled about
(0, 0). PathData::bounds, which the selection's box, Align, Transform
Each and every later effect in the stack use, holds lone anchors.
- geom: anchored_curve_bounds measures a BezPath as PathData::bounds
measures the path it stands for.
- render, effects and the .ai reader give geometry effects that box.
Gradient reference boxes and clip regions are unchanged.
A round or projecting cap draws a dot for a closed subpath of one anchor.
The bounds the effects are measured by left that dot out: the visual and
cull bounds, the box Rasterize makes its image over, and the reach of an
effected path's raster effects. A path of only lone anchors was measured
at the origin.
- `vectorcraft_geom::path::drawn_curve_bounds` measures a kurbo path as
`PathData::drawn_bounds` measures the anchors it stands for.
- `crates/render/src/fx` measures effected paths with it, and a path that
draws nothing by its anchors, as `Node::visual_bounds` does.
- A stroke measured along its segments (miter and bevel joins, projecting
caps) gives the dot of a closed lone anchor its reach.
In Outline mode without Show Images in Outline Mode, an envelope holding
a placed document distorts the document's crossed box, since the
envelope reads the art that PlacedDocument::art gives while placed
documents are crossed. Each step of a blend of placed documents is a
placed document itself, so it is drawn crossed.
- outline_mode_warps_an_enveloped_placed_documents_crossed_box: an Arc
warp of a placed document draws the same pixels as the same warp of
its crossed box as a plain path, and the file's art with Show Images
in Outline Mode on.
- outline_mode_draws_each_step_of_a_blend_of_placed_documents_crossed:
the step between two placed ends is crossed, and drawn uncrossed with
the option on.
Docs: docs/ui-parity.md row, docs/mcp.md outlineImages.
The render crate's placed-document tests decided results by wall-clock
time:
- The gate that holds the background worker opened by itself after 10 s,
so a test that forgot to open it still passed. It is now a mutex and a
condition variable with no time limit, opened when the guard that
shut_gate returns is dropped (also when the test fails).
- settle polled busy() every 5 ms for up to 10 s. It now waits on
placed_document::wait_idle, which a condition variable signals when
the last pending bitmap is finished.
- The self-placing document test asserted that drawing took under 10 s.
It now asserts how deep the drawing went (at least 2 levels, at most
MAX_DEPTH), read from a test-only counter kept by the depth guard.
In Outline mode without Show Images in Outline Mode, a placed document
with an effect that changes geometry (Transform, Roughen, plug-in
effects), its own or its group's, drew its file's art reshaped and
without the X. The effects now reshape the crossed box instead, so a
Transform effect moves the crossed box.
- While a frame draws placed documents crossed, a placed document's art
is its box with both diagonals (PlacedDocument::crossed_art), so every
effect and evaluation that reads that art uses the crossed box.
- Layers are drawn and measured in the mode their Layer Options give
them: a template layer in Outline view still shows the file's art,
and a layer or sublayer whose Preview is off shows the crossed box.
A layer with effects of its own now follows its Layer Options too;
before, it drew in the view's mode.
- Kept effect art, cull bounds and the areas redrawn after an edit are
measured in that mode and kept apart per mode.
Docs: docs/ui-parity.md row done, docs/mcp.md outlineImages.
A selected group or layer outlined and marked a member made into a guide
while the guides were hidden, and the art of a template sublayer while
View > Hide Template was on, although the canvas does not draw them.
- Node::hidden_by_view (crates/doc/src/node/ops.rs) holds the rule; the
renderer's left_out now uses it too.
- walk_drawn and the overlay's point limit in canvas/outline.rs leave out
the members the view hides, so the selection's outlines, key outline,
anchors, hover outline and point count skip them.
- The selection's bounds are unchanged.
The white checks for colorized images in PDF export, EPS export and Print
Ink Fixes now go through DiscardWhite, which replaces
Document::spot_ink and Document::discards_white_overprint. Printed
separations read DiscardWhite with the spot inks they print, so a white
spot ink converted to process inks knocks out there.
With Discard White Overprint on, PDF export, Overprint Preview,
Separations Preview and printed separations took the overprint off any
white paint, including a tint above 0% of a spot swatch whose color is
white, which prints as that ink. Such a tint now keeps its overprint in
fills, strokes, character paints and a colorized image's color; process
white and a 0% tint still knock out.
DiscardWhite holds the setting and the document's spot inks, and
Document::discards_white_overprint gives the same answer for the PDF and
EPS writers.
A linked image whose file is missing shows its full-color preview as it
is, without its colorize paint, and separations and PDF export already
print it that way. Overprint Preview and simulated overprints in
composite output still darkened the whole image. darken_overprints and
image_overprints_whole now take the document's images and leave such an
image at its own blend mode, and the helpers that find the pixels a
colorized image shows move from the separations code to
vectorcraft_doc::overprint so both use them. The preview's cached art is
made again when the document's images change.
A placed file whose own Show Images in Outline Mode is off shows its linked
image's pixels in grayscale, uncrossed, when this document's setting is on.
In Outline mode, with File > Document Setup > Show Images in Outline Mode
off, a linked image's frame is crossed from corner to corner, following
the corners of a turned or distorted image. A placed document shows its
box crossed, and its file's art no longer draws in Outline mode unless
the option is on. Embedded images keep a plain frame, and so do the
pieces that an envelope cuts an image into.
A placed document with raster effects or color adjustments stays
crossed. One with an effect that changes geometry, its own or its
group's, still draws its file's art reshaped and is not crossed yet.
With the option on, images show their pixels in gray and placed
documents show their art. The art inside a placed document now follows
the option of the document it is placed in rather than the placed
file's own setting.
Linked files showing as a box with an X in Outline mode is described at
https://helpx.adobe.com/illustrator/using/viewing-artwork.html; the
other rules are VectorCraft's own.
Docs: docs/ui-parity.md, docs/mcp.md; document.setup params text for
outlineImages.