A live-effect plug-in that paints its pieces draws each piece's brushed
stroke along the piece's path at the piece's stroke width. Culling left
room for brush art from the object's own stroke width around the
pieces, so brush art of a moved or wider piece was cut off at the edge
of the view. Culling now leaves 16 x the piece's stroke width + 8 pt
past each brushed piece, and does so for a symbol instance whose art
holds such a path (measured once per symbol) and for a blend, envelope
or repeat that holds one. Object > Rasterize measures the brush art
drawn along each piece and leaves out the object's own brush art, which
is not drawn.
Groups and layers now leave room for their members' brush art. The
cull bounds of a group or layer united its members' bounds without the
room each brushed member leaves, so the painted bounds of a group, and
the area redrawn when it changes, left out brush art past its members'
strokes. That applied to plain brushed paths as well as painted pieces.
Each member is now measured as the renderer measures it when it draws
the group, in the members of a group with a fill, stroke or adjustment
of its own and in a group with crop marks or Vector Halftone too.
- The link watch and links.updateChanged look at a DCS file's plate files
of their own, so a changed plate file is read again.
- links.update and links.relink apply the file's clipping path to the
images in symbols, graph designs, patterns and masks too. When the new
file has no clipping path, a clip group holding the old file's clipping
path loses that path and stays as a plain group of the image, keeping
its id, name, visibility and transparency. The image keeps that path with its plates to tell it from a
clipping mask made in the document; a clipping path given another fill
rule in the document stays. An even-odd clipping path in the file is
kept as the same area under the nonzero rule.
- links.update and links.relink return the swatch warnings file.place
gives, including two files that add one ink in two colors.
- links.relink with copy fails for a DCS file with plate files of its own.
- file.place answers the image id of a clipped DCS placement as image,
and checks page and crop for a DCS file as it does for an EPS file.
- Print separations and Separations Preview take a spot plate's color
from the document's swatch of its ink, and a reduced image's plates
keep their coverage.
- Show DCS Transparency Interactions counts a transparent DCS image and
characters filled or stroked with a transparent gradient.
- %%PlateFile names keep their spaces, and header bytes that are not
UTF-8 are read as Latin-1.
- A plate program that draws more than one image, art besides its image,
or its image through a clipping path is an error naming the plate
instead of printing the wrong ink.
- Nested clipping paths around the composite clip the image together.
- A kept image with more plates than are read, or more TIFF directories
than its composite and plates, is the CMYK image of its composite
only, not a set of plates cut short.
- swatch.unused counts a spot or process swatch as used only while an
image the art shows has a spot plate of its name.
A geometry effect on a symbol instance's topmost fill now reshapes the
filled shapes of the symbol's art, and one on its topmost stroke reshapes
the stroked shapes, keeping their colors, strokes and other detail. Only
a visible topmost fill or stroke with an opacity above 0 counts. Clipping
paths, guides and opacity-mask art keep their shapes; a group's own fills
and strokes in the art take the effects; a nested instance passes them on
to its own art, except one whose symbol holds the outer symbol.
The canvas, Use Preview Bounds and the drawn bounds, SVG and PDF export
and Object > Expand Appearance use the same art. Expand Appearance is
enabled for such an instance and turns it into an editable group in one
undo step. Bounds measure the art with a dynamic symbol's overrides, as
the canvas draws it.
Existing documents with a geometry effect on a symbol instance's fill or
stroke draw differently: before, the effect drew nothing.
A Transform effect on a group reshaped its members' paths but left the
raster effects inside it at their own values: a member's Drop Shadow
kept its 10 pt offset under a 200% Transform effect, and with Scale
Strokes & Effects on, it scaled by the mean scale without turning. The
same held for the raster effects of an object's own fills and strokes
under the object's Transform effect.
- A Transform effect that moves the art once now transforms the raster
effects of a group's members (their own and their fills' and
strokes'), of nested groups, of the art of the linked opacity masks
in it and of an object's fills and strokes, after the members' own
Transform effects: sizes scale by the mean scale and a Drop Shadow's
offset turns, reflects and scales. A raster effect that a member's
own Transform effect with copies or random holds back keeps its value
through that effect and still transforms with the group's. Scale
Strokes & Effects does not scale them a second time. A group's or
object's Transform effect that makes copies or moves at random leaves
them as before.
- The canvas, the redraw region, export, Expand Appearance, Object ›
Expand and Outline Stroke read the same values.
- The Transform effect's params text and docs/target-app-parity.md
describe the rule.
When the document does not hold a color mask's masked pixels, the image is
drawn from its own pixels. A live color adjustment now recolors those pixels
and drops the mask on the recolored copy, instead of pointing the image at
the missing masked pixels, which drew nothing and left Expand Appearance with
an image whose pixels were not in the document.
File › Place with Link reads a DCS 1.0 or 2.0 file (an EPS file whose
header names one EPS program per printing plate) as one linked image of
its plates. Each spot plate adds a spot swatch in the CMYK values the
file gives, and the clipping path the file's composite is drawn through
clips the image. document.open, file.place without link or from bytes,
and links.embed refuse a DCS file and change nothing.
- The screen, composite print and exports show the plates mixed into
CMYK. Separations Preview and print separations show each plate on
its own ink; a spot plate prints as its CMYK values when spots print
as process.
- links.list answers the format DCS, and with dcsTransparency marks the
DCS images that are transparent or overlap transparent objects (the
Links panel menu's Show DCS Transparency Interactions).
- swatch.unused leaves out a spot swatch while a DCS image has a plate
of its ink.
- links.update and links.relink read the plates and the clipping path
again, and the link shows as modified when one of its plate files
changes or is gone.
- The plates go on the first plate's pixel grid, grown to hold every
plate where it prints; a plate of another size or position is
resampled onto it.
- A file may name 64 plates, a plate file may be 1 GB, and the plates
together may hold 512 MB of ink amounts. A file naming more plates is
an error.
Docs: docs/mcp.md, docs/target-app-parity.md, docs/file-format-parity.md.
pattern::tests::kept_tiles_count_the_images_they_could_not_decode
draws a pattern whose art is an image three times and expects one tile
to be rasterized. A tile of art with an image is kept only while
FontDb::global().generation() is the one it was drawn at (Deps::current
in pattern.rs). The render tests that hold adding_fonts() add fonts,
which increases it (tests/fontchange.rs, tests/typeedges.rs,
tests/alternate.rs, tests/colrglyphs.rs and tests/bitmapglyphs.rs).
When one of them added a font between the frames, the next frame drew
the tile again and the test failed with left 2 or 3, right 1. Run with
the tests in tests/fontchange.rs and tests/typeedges.rs, it failed in
23 of 30 runs on main.
The test now holds fonts_steady() and takes its counts from
with_fonts_unchanged(), as the other render tests that count kept work
do. Each run builds a new document, so its first frame does not find a
tile from an earlier run. Run with the same tests, it passed in all 30
runs.
A linear, radial, conic or diamond gradient has a spread: Pad (the
default, as before), Repeat or Reflect, with a count of 1 to 100
(VectorCraft's own limit). Repeat and Reflect run the stops that many
times along the vector (around the turn for a conic) and keep going past
both ends, Reflect running every other run backwards, as SVG's
spreadMethod does.
The Gradient panel has a Spread menu and a Repeats field, and the
Gradient tool marks where the runs meet. paint.setFill and
paint.editGradient take `spread` and `repeats`; bad values are errors.
Presets, swatches, blends, strokes along or across a path, Outline
Stroke and Object › Expand follow the spread; Expand gives each run the
same whole number of objects, and Outline Stroke's mesh keeps the color
on each side of a sharp step between two stops at one offset.
SVG writes and reads spreadMethod: SVG import now reads a repeating or
reflecting gradient as one that repeats or reflects once, instead of
expanding its stops over the shape. CSS writes repeating gradients.
PDF writes a conic's sweep shading over one run. PDF, EPS, legacy .ai
and the .ai editing data write the other kinds with their stops
repeated across the shape: at most 256 runs and 16,384 stops (256 stops
in .ai files), and for a radial or diamond no farther than 65,536 runs
from its center, with a warning past those. PDF import now finds sharp
steps in any axial or radial shading instead of blurring them.
Docs: docs/mcp.md (Spread), docs/target-app-parity.md, docs/gaps.md.
The canvas kept the art of an image whose own fill or stroke follows the
outline of its pixels for as long as the image object stayed the same. When
the document's pixels for the image changed under the same key (Update Link
replacing a preview with the linked file's pixels), the stroke kept the old
outline while hit testing and Use Preview Bounds used the new one. The
renderer now keys that art by the document's pixels for the image too.
- vectorcraft-effects: `follows_image_pixels` names such images.
- vectorcraft-render: `reads_outside` counts them, and the resources key
hashes the address of the document's pixels for them; their walk is not
kept between frames.
- A test places an off-center opaque area in a smaller copy of the pixels
under a turned and reflected placement.
- Docs: the Outline Object params text names every case that keeps the frame
and the 50% cutoff as VectorCraft's own; docs/mcp.md's `effect.apply` entry
for Outline Object, how long an outline is kept and the 16-bit RGBA limit;
docs/target-app-parity.md's evidence lines.
Object › Plug-ins › Image Tools gains Color Mask… (`addon.image.colorMask`),
Remove Color Mask and Apply Color Mask. Color Mask hides colors of the
selected images without changing their pixels. It matches colors as Remove
Background does: the edge color, the corner color or picked colors, with
Contiguous, Match, Tolerance and Softness. The mask is kept with the image
object and saved with the document: its settings, and a PNG of the image's
pixels with the hidden colors made clear, at the source's depth with its
color profile and resolution. It is a VectorCraft addition.
- The canvas (clip groups and white-shape opacity masks included),
printing and separations, PDF (soft masks of CMYK images included), SVG,
EPS, the raster formats, the legacy .ai and .ai editing data, EMF/WMF,
DXF and the flattener draw the masked pixels. A linked image stays
linked, and an output that would refer to its file writes the masked
pixels instead.
- Copy and paste, placing a document and placed documents carry the masked
pixels with the image, under the names they are given there.
- The dialog opens on the selected image's mask settings, with a Preview.
Without settings, the command returns them and changes nothing.
- Setting, removing and applying a mask are each one undo step, and no
step is added when nothing changes. Apply makes the masked pixels the
image's own and embeds a linked image. A mask that hides nothing is only
taken off, and the image keeps its pixels and its link.
- When an image's own pixels are replaced (Update Link, Relink, Crop
Image, a recolor, a linked file read again on open), its mask is made
again for the new pixels, in every art tree and in opacity-mask art.
Crop Image cuts the image's own pixels. When the new pixels can't be
masked, the mask keeps its settings and hides nothing.
- Objects in `ids` that are not images, CMYK images, linked images that
show their preview, images past the decode allowance, masks that would
hide every pixel, and grayscale images colorized with a process color
are refused. The Eyedropper, Object Mosaic, Create Gradient Mesh, Crop
Image's trim and Image Trace read the image's own pixels.
- An image is selected by a click anywhere in its frame, as before.
Remove Background now also refuses a grayscale image colorized with a
process color. Its result has an alpha channel, and a process color is
refused on a grayscale image with transparency.
Docs: docs/mcp.md (Image Tools add-on › Color Mask),
docs/target-app-parity.md.
An object with an opacity mask draws offscreen over the bounds the
renderer gives it. For a live object (a blend, envelope or repeat) those
bounds took in effects in symbol art and brush art inside it, but not a
path's own effects, so with Clip off the drop shadows of a blend's steps
were cut off at the steps' bounds and did not draw where the mask art
leaves them uncovered. The bounds now also take in how far each path's
own effects paint past it.
Effects apply in the order they are listed, so a Drop Shadow, glow, blur,
Feather or pixel filter listed before a Transform effect paints art that
the Transform effect then transforms. VectorCraft drew such an
effect at its own distances around the transformed art: a square scaled
to 200% kept a 10 pt shadow offset. Now the effect follows the Transform
effects after it, with Scale Strokes & Effects on or off: its sizes scale
by the mean scale, and a Drop Shadow's offset turns, reflects and scales
with the art. Effects listed after the Transform effect keep their values,
and Transform Objects off changes nothing.
- raster_effects reads each raster effect through the Transform effects
after it, so the canvas, export and the redraw region use the followed
values.
- Where the geometry effects are applied and removed (Expand Appearance,
baking for export, evaluated groups), the raster effects that remain
carry the same transformation, hidden ones included.
- A Transform effect that makes copies or moves at random leaves the
raster effects before it as they are. Rasterize and SVG filters keep
their options.
Docs: the Transform effect's params text, docs/target-app-parity.md.
A new gradient kind, `diamond`, runs its stops from the center (the
start) out to a square with a corner at the end of the vector; the
aspect stretches the square across the vector into a rhombus. The
Gradient panel's Type row has a Diamond button, the Gradient tool draws
the square with the aspect handle and center ring, and a gradient
fitted to an object covers its box.
- Model and canvas: the level is |x| + |y| in the square's frame; a
square with no area (no vector, an aspect of 0, numbers out of range)
paints the last stop. The canvas draws it as pixels, out to a
stroke's miters, caps and arrowheads. Transforms keep the vector and
take the mapped size across it as the aspect.
- Commands: `paint.setFill`, `paint.editGradient` and
`paint.setGradientGeom` take `kind: "diamond"`; a negative aspect or
a focal point is an error. A conic or diamond gradient that a plug-in
returns with a focal point loses the focal point.
- Gradient tool: dragging the aspect handle of a radial or diamond
gradient whose file gave it a negative aspect now sets a positive
aspect; only a conic's negative aspect mirrors it.
- Export: PDF, SVG, EPS and legacy .ai write four linear gradients, one
for each quarter of the square, clipped to the shape (PDF as axial
shadings). PDF and SVG write an image for translucent stops, a
dithered fill or a flat square, and for the Perceptual method unless
PDF writes the stops as spot color shadings. SVG writes a diamond on
type characters as a radial gradient through the corners, and so
does CSS. A swatch library saved as CSS gets four corner layers, a
value for the `background` property (a circle when the swatch is
turned by an angle that is not a multiple of 90 degrees). The .ai
editing data holds a radial gradient through the corners. The
document exports give a warning.
- SVG export: a stroke drawn as an image, as conic wedges or as diamond
quarters now covers the miters, caps and arrowheads that reach past
its paint box.
- PDF import reads a function-based shading whose color is the same
along each square about the origin of its space as a diamond.
- Object > Expand gives nested squares or a mesh of rings.
Docs: docs/mcp.md, docs/target-app-parity.md.
Each of the fifteen Warp styles now bends the bounds as one Bézier patch.
The style sets the patch's control points from the bend and the size of
the bounds, the horizontal distortion scales each column of control
points about its middle, and the vertical distortion scales each row.
The Warp effects and warp envelopes share the map (`WarpNet`). Content
with no width or no height takes the middle of the patch along that
side.
A warp carries the map it draws with as `version`. New warps, the
built-in graphic styles' Warps and warps opened from .ai files get 1.
Warps in .vectorcraft documents saved before the version existed read
as 0 and keep the earlier map, so those documents keep their look.
Edits keep a warp's version, and Warp Options editing several objects
keeps each one's own. effect.apply, effect.setParams and the warp
envelope commands take `version` 0 or 1 (`1.0` counts as 1) and refuse
any other value. An .ai file holds a warp's settings and not its
version, so a version 0 warp saved to .ai opens again with version 1.
The .ai writer compares a style's settings without the version, so
saved warps still export as editable effects.
Docs: docs/mcp.md (Envelopes), docs/effects-parity.md (Warp),
docs/target-app-parity.md.
With a TIFF preview, each EPS file's PNG thumbnail is now the preview
averaged down to the thumbnail's size and composited on white, so
export and Save draw the page once instead of twice. The thumbnail
keeps the size a 128 px render of the page has; a page that fits in
128 px gets the preview's own pixels. Without a preview the thumbnail
is still drawn.
- Rendered::area_resized averages premultiplied pixels over the area
under each new pixel, weighting edge pixels by the share they cover,
and returns an error for a 0 side or a buffer that does not match.
Before drawing a shape, the renderer checks that its control points stay
within the rasterizer's limits. For a long path it measured every point
of the path for this check in each frame. The kept path of a long path
now keeps the box of the points of each run of segments next to the run's
bounds, updates it with the runs an edit changes, and answers the check
from those boxes.
With a closed path of 200,000 anchors and no paint (release build,
single-threaded, medians of 21 frames), the part of the frame redrawn
after one anchor moves took 1.93 ms instead of 2.69 ms, and drawing the
same part again with nothing changed took 0.015 ms instead of 0.343 ms.
A fourth gradient kind, conic (also accepted as `angle` or `conical`),
sweeps the stops once around the center (the gradient's start),
clockwise on the page from the vector, with a seam where the last stop
meets the first. A negative aspect mirrors the sweep, and reflecting an
object turns its sweep the other way, also for a conic without a
vector or with a flat extent.
- Gradient panel: a Conic button in the Type row; the Aspect Ratio
field works for conic gradients and keeps a mirrored sweep mirrored.
- Gradient tool: the extent ellipse, aspect handle and center ring of a
radial gradient, without a focal point.
- Rendering, swatch chips, transforms, warps, plug-in round trips, and
Object > Expand into wedges or a mesh of columns around the center.
- Commands: a negative `aspect` is an error for linear and radial
gradients, and so is a `focal` point for a conic gradient.
- PDF export writes a function-based shading whose calculator function
turns the angle into the ramp, and PDF import reads a function-based
shading that turns around the origin of its space back as a conic
gradient, also when that origin lies outside the painted area. A
PDF/A file, or a conic with more than 97 stops, gets an image
instead.
- SVG export writes 360 solid wedges clipped to the shape for opaque
stops and an image otherwise, and a linear gradient on characters.
- CSS export writes `conic-gradient(from ...)`, with the stops mirrored
for a mirrored sweep.
- EPS and legacy .ai export write 360 solid wedges; the .ai editing data
holds a linear gradient along the vector with the same stops.
- .af files: conical gradients open as conic gradients.
- An export that writes the gradient in another form gives a warning.
Supersedes #2326 and includes switch87's code from it.
Co-authored-by: Gert Pellin <gert@pellin.be>
Ruler guides were a list kept beside the layers. Each guide is now an
object of its layer or sublayer, always directly in it and above the
layer's art. These behave as on main:
- Guides draw on screen only. Exports (SVG, PDF, PNG, PSD), Fit All,
Select All, the art bounds, clicks and marquees, and a layer's
Pathfinder and Transform effects leave them out. The Layers panel
lists them as guide rows of their layer, the highest guide.list
index first.
- Deleting a layer deletes its guides, and merging layers keeps their
guides in the merged layer.
- The guide commands number guides as guide.list does, in the order
they were made.
New: each guide takes an id from the document's object ids. An object
command given a guide's id fails with an error, and node.move cannot
put a guide into a group or out of its layers. A guide made while an
opacity mask, a symbol or a pattern is edited moves to the top
visible, unlocked layer when editing ends.
File format: native files still save the guides in the document's
guides list, in every file version, so older builds read them. Each
entry may now also carry the guide's id, name, locked and hidden
flags; older builds ignore those fields. Opening a file puts each
saved guide on its layer (on the top visible, unlocked layer when the
file names none or a layer it does not have), and each saved guide
counts against the object limit for opening a file. A ruler guide node
that a file holds below a layer's art moves up to the layer's guides,
and one anywhere else (in a group or another object, beside the
layers, or in a symbol) is removed. Ruler guides read from an .ai file
become guide objects on the layer they were on, numbered in the order
the file lists them.
A placed document drawn without a bitmap (renders without progressive
placed art, exports) drew type in the placed document's own composite
font in the fallback font: only the outer document's composite fonts were
lent to the font database. The placed document's composite fonts are now
lent while its art is drawn.
A symbol whose natural size is not 20 x 20 is drawn through its 9-slice
guides by an instance that only moves, so art the guides move can draw
outside the art box moved by the instance. The visual box took that
moved art box alone, and the renderer culled the instance when only the
moved art was in view. The visual box now measures such an instance as
it does a scaled one.
Raster renders, ink renders, thumbnails and node renders now lend the
document's composite fonts to the font database while they draw, as the
PDF, SVG and EPS writers already do. A document that is not in front, a
document read from a file (library thumbnails, save previews) and a
placed document's art drew such type in the fallback font or in another
definition of that name.