Rustdoc builds each doc test as its own crate, without the workspace's
`unsafe_code = "deny"` and without a library's `#![forbid(unsafe_code)]`,
so a doc test holding an `unsafe` block passed `cargo test --doc`.
- Every library root now carries `#![doc(test(attr(forbid(unsafe_code))))]`,
or `deny` in cad, eps and metafile, which rely on the workspace lint.
- `cargo xtask layers` reports a library whose doc tests are missing the
attribute, or use `deny` where the library forbids unsafe code.
- AGENTS.md names the rule next to the `unsafe` allowlist.
The cell-clipped dots split every elliptical arc at 45 degrees, and the
quadrants were joined with a zero-length line where they met on an axis.
A round dot that stays inside its cell had 8 curves and 3 extra anchors
instead of 4 curves, and the halftone's SVG export grew to about twice
its size.
- Arcs are split at 90 degrees, one curve per quarter turn.
- Quadrants and spot corners that meet at the same point are joined
without a line, so the join adds no anchor.
Tests: an unclipped Circle and Ellipse dot is 4 curves and no line, and
no dot shape repeats an anchor where its quadrants or corners meet.
The gate's test-lint step failed on `unshaded_surfaces_show_their_paint`:
its `assert!(...all(...))` had no length or emptiness check. The test now
takes the largest channel difference and asserts it is `Some(0..=1)`, so an
empty comparison fails and the one-unit tolerance per channel is unchanged.
- Rendered eligibility reads only the top fill and strokes, the same items
the solids are built from, so a lower gradient fill no longer blocks it.
- A later Pathfinder effect falls back to shaded faces with the paths-only
warning, as geometry effects do.
- Live 3D edits show the fallback warning for one or several objects.
- Raster Settings shows the resolution field as mixed when the selected
objects' effective resolutions differ.
- A curved highlight edge that crosses its neighbor keeps the outline.
Circle and Ellipse dots that fit inside their cell use the four-anchor
ellipse path again; the quadrant builder is kept for dots that need
clipping. The style tests use a gray fill, so an explicit shape that is
ignored changes the result. docs/control-protocol.md lists the dialog's
style field.
The clip matrix refused a depth range whose depth slope came out
negative, which happens when the nearest point is close to the eye
(eye 100, depths 0 to 99.5), and the solid fell back to shaded faces.
The mapped depth rises between the two ends whenever w is positive at
both, so the check now tests w and the mapped depths instead of the
slope. A test covers that range and a range that reaches the eye.
The resolution test also checks that the rendered image carries its
pixels, and docs/mcp.md and docs/target-app-parity.md say that
rendered shadows need both Shading and Shadows on.
Parse tests in the color crate looped over every id or label and parsed
it back. Blend modes, policies, harmony rules, recolor methods and WCAG
categories parse by looking the text up in that same table, so those
loops could not fail. They now parse representative ids, labels and
spellings, and the edge cases: "Color" next to "Color Burn", empty
text, and a label where only ids parse.
- default_swatches_parse read swatch.rs as text. It now checks the
built swatches: no two solid swatches share a color (a bad hex
literal falls back to black), and the Sunset and Ocean stops equal
the swatches their literals name.
- loads_system_cmyk_icc ran only on macOS and returned early without
the system profile. loads_icc_files_and_refuses_bad_ones runs on every
native target: a missing file is an I/O error naming the path, a file
that is not a profile is refused, and a built-in profile's bytes are
refused for their name.
- the_other_libraries_keep_classic_mixing_and_centered_midpoints is
removed: those libraries are built with Gradient::new's defaults.
- pixel_timings and bench_catalog_lookup are removed. They were ignored
and only printed timings.
- Checks over lists that can be empty now also check the count:
reverse and move keep every stop, a conic draws its 4 wedges, each
harmony gives at least two colors, the fit leaves patches out, the
wireframe draws edges, a flat warp keeps its anchors, a gradient
stroke has slices, and fitted dashes on a curve are drawn.
- the_effects_are_colour_adjustments_in_their_own_menu checks one
add-on effect and one effect outside it instead of every entry.
The dialog hides Shape and Angle, and leaves them out of the command,
only for a style that names a preset. Custom, no style and a style this
build does not know keep the stored Shape and Angle on screen, since the
renderer uses them. object.vectorHalftone refuses a null or non-string
style; Custom applies only when the key is left out. The shape docs now
say that partial-tone circle, ellipse and diamond dots stay inside their
cell, sized to keep the tone's coverage.
A dot at full tone is now the cell's exact square for every shape but
Line, which keeps its overlap along the row. Before, a full-tone Diamond
or Grid Dots dot was built from its clipped shape, leaving near-duplicate
corner anchors and small gaps between cells.
The live effect's dialog and the Appearance panel's inline editor spell a
stored style such as GRIDDOTS or CUSTOM as the picker's id, so the picker
shows it selected while its choice ids stay the ones the dialog accepts.
effect.apply and effect.setParams stored an unknown style such as
"gridDot", which the effect drew as Custom while the dialog hid Shape
and Angle. Both commands now refuse it before editing, as
object.vectorHalftone does, and accept the named styles in any letter
case.
Dot quadrants that meet on an axis, and the corner cutouts of Euclidean
and Elliptical dots past half tone, were joined with a zero-length line
that added duplicate anchors. They now join directly. A zero-tone dot
gives an empty path instead of closing a path with no start.
The params text, docs/mcp.md and the progress line describe the style
rules.
The Circle dot now stays in its cell and fills it at 100%, which is the
look the Grid Dots styles need, so gridDots and gridDotsAngle use circle
at 0 and 45 degrees and the separate Cell Dot shape is removed. The
dialog's OK and preview leave out the hidden Shape and Angle while a
named style is picked, so the style's own shape and angle apply.
A new `style` parameter on object.vectorHalftone and the live effect sets
the dot shape and screen angle: grid is Euclidean at 0 degrees, gridAngle
Euclidean at 45, gridDots and gridDotsAngle a new Cell Dot shape at 0 and
45. A shape or angle given with a style wins in the command, and an
unknown style is refused. The dialog adds a Style choice and hides Shape
and Angle while a named style is picked.
The Cell Dot shape is round until it touches its cell's sides, then is cut
flat by them, so the cell is solid at 100%. The Circle shape is unchanged.
* fix(effects): draw dark dots in RGB Color Halftone
(cherry picked from commit 2dbe91af9f)
* Cover dark-on-light RGB halftone polarity
Updated halftone tests to clarify behavior regarding pixel brightness and dot sizes.
(cherry picked from commit babd60e332)
* effects: bound Color Halftone dots at full coverage
(cherry picked from commit 8fb0bf55607762df6e3acc2ed7ed37a643fea022)
* effects: describe Color Halftone ink coverage
(cherry picked from commit 0dbf12514095b6e12cb4414055d8ac47ee1fbcdc)
* Document the change to saved RGB halftones
* Test the bounded edge overlap of full halftone dots
---------
Co-authored-by: Mex <[email protected]>
Co-authored-by: dotCooCoo <[email protected]>
Circle, Ellipse and Diamond dots were sized by their own area and drew
past their cell once they reached its sides. In dark tones neighbors of
different sizes overlapped into notches and slivers where the dots
joined, and even full black left white specks at the cell corners.
These dots are now clipped to their cell and sized so the clipped dot
covers the tone. Neighbors meet along the shared side, and full tone
fills the whole cell. Light tones, where the dot stays inside its cell,
draw as before.
- A material's highlight over a curved face now covers the face's seam,
as the face's clip does, so curved faces no longer show a dark fringe.
The outline is validated flattened, split at its extrema, with a
clearance for the flattening error; a face that folds over itself
keeps its outline alone.
- Render Settings shows while any selected object's 3D effect takes it,
whatever the selection order and whether the first object has an
effect.
- Raster Settings OK leaves out values equal to what every object
already holds (the document's resolution, a shared custom resolution,
a shared background), so an unchanged OK records no undo step.
- meshes_carry_the_material requires the default-material meshes to
build and be non-empty.
- docs/mcp.md and the progress-doc line list every case that draws the
shaded faces instead of the rendered image.
The Normal-mode test compares the default output with blurMode=normal,
so a fault both share passes it. Three checks now stand on their own:
- A 6-pixel row at radius 2 checks exact averages that a radius-1
search gives differently (105 and 115 at the ends instead of 110).
- A step from gray 100 to 200 at radius 12 checks that the pixels next
to the step read the box-blurred copy at threshold 50 and keep their
gray at threshold 30, that pixels far from the step keep theirs, and
that medium quality takes in less of the other gray than low.
- A one-column gray-200 stripe at radius 12 checks that a neighbour
whose own value is past the threshold stays out even when its
blurred value is within it.
- A 5 x 5 image at radius 2 checks that a pixel two columns away counts
and one two columns and two rows away (outside the disc) does not.
- A 7 x 7 image with default settings checks that the default radius
of 3 reaches a pixel three columns away.
- The radius-1 threshold test gives its last two pixels the same color
with alpha 255 and 128, so it fails if alpha is left out.
Seven render, brush and effects tests accepted results well away from
the value the code is meant to give:
- The two linear gradient tests now expect the value at the pixel
center (126 of 255, red 126 and blue 129) within 2 levels, instead of
12 or 20 around 128.
- The trimmed bristle strand test bounds the width ratio on both sides.
- The calligraphic roundness test expects the 0.1 pt hairline within
1e-6 pt.
- Pucker & Bloat expects the corner anchor at (12.5, 12.5) and
(-12.5, -12.5), not only the sign of the move.
- Exposure's offset and gamma checks expect the sRGB value within 1e-5.
- Smart Blur's checksums of earlier output are replaced by a 4 pixel row
whose averages are worked out by hand.
Each new assertion fails when the code it covers is changed (the
gradient stops shifted, the pressure, roundness, pucker, offset or gamma
factor changed, or the blur threshold widened).
The shaded faces show the first light's shadow, and Render Settings ›
Rendered draws the shadows of every light with an Intensity above 0.
The Shadows table, its notes, the differences list, the effects summary,
docs/mcp.md and the shadow params text of Extrude & Bevel, Revolve,
Inflate and Rotate now say which mode they describe.
A new test checks that PNG export gives the pixels the canvas draws at
export quality, and that the rendered image has as many pixels as the
shaded faces' bounds times the resolution over 72, rounded up as a
raster effect's image is.
quadrant() had local closures that repeated ellipse_arc() and segment().
It now calls those helpers, as elliptical_quadrant() does. The geometry
is unchanged.
Several tests returned early when the code under test gave back nothing,
so the regression they guard against passed. Each of those guards now
checks only what the host provides (an installed face, the bundled
fonts), and the output itself is asserted:
- PDF live text: the lam-alef face is no longer picked by whether its
type imports (#6072); Insert Kashidas asserts the kashida and the
imported type.
- Effects and Expand Appearance on type assert the outlines and the
drawn type when the default face is installed.
- The OpenType panel's Stylistic Sets test asserts sets with the
bundled fonts.
- Thumbnail worker tests assert that the worker starts; the memory
peak test asserts a reading.
- The json2 test checks the interpreter's Date, replace and RegExp on
every run, before looking for json2.js.
- Devanagari arrow keys and the Arabic narrow-area wrap assert the
layout they set up.
Below 50% the Elliptical dot was an ellipse clipped to the cell's
diamond, so from 40% horizontal neighbors met at a single point and at
50% the dot reached the vertical neighbors too. The dot is now an
ellipse as wide as its cell at 40%; past that it is clipped to the
cell's side, which makes a bridge to the next dot, and to a middle-tone
cut line through the quadrant's center, which keeps the short side
apart until 60%. Areas still match the tone.
Object > Vector Halftone and the live Vector Halftone effect get two
dot shapes that follow the classic spot functions. Euclidean dots are
round in the highlights, meet corner to corner at 50% as a checkerboard
and turn into round holes in the shadows. Elliptical dots are long,
join into chains along their length at 40% and on every side at 60%,
then turn into long holes. Each dot is a vector path whose area is the
cell's tone. The existing Ellipse shape is unchanged.
A rendered Extrude & Bevel, Rotate or Revolve followed by a visible
geometry effect that reshapes paths but not images, such as Pucker &
Bloat or Roughen, now draws and measures the shaded faces so the later
effect still applies, and the status bar reports why. Transform, Warp
and raster effects keep the rendered image.
- With Shadows on, every light with an intensity above 0 casts shadows on
the solid and on the shadow plane in the image, black at 50%, with each
light's Softness widening its edge; with Shadows off none does.
- Selection, Use Preview Bounds, Align, hit testing and snapping measure
the shaded faces without rasterizing. Painted bounds hold the whole
image, measured without rasterizing. Images are cached by their inputs.
- Expand Appearance and baking keep the rendered image; PDF export in a
CMYK document writes it as raster effects are written.
- Render Settings gains Raster Settings... (resolution and background),
built on the framework's parameter dialog; settings the selection holds
differently open blank and are kept. The menu checks a choice only when
every selected object has it.
- Tests for the clip matrix, coverage, depth order, the shading formula,
limits, work bounds, edge values, masks and Revolve's objects-only rule.
Docs: docs/three-d.md, docs/mcp.md, effect params text.
The two Extrude & Bevel tests of the faces an object's solids keep together built members
and strokes from 16,384-corner polygons until they passed MAX_OBJECT_FACES. They took
230 s and 23.5 s on CI. The solids code now reads the limit through object_face_limit(),
which tests can lower on their own thread (OBJECT_FACE_LIMIT), and both tests build
64-corner polygons against a limit of exactly three members' or three strokes' faces. The
limit is now met exactly, so the tests also check that a solid at the limit still draws.
Outside the crate's own tests, object_face_limit() is MAX_OBJECT_FACES.
The smoothing test of every pair of gray levels ran the filter on 262,144 one-pixel-pair
images, and each pass along a column started two threads. It now puts every pair in one
2-pixel-wide image and one 2-pixel-high image, so it checks the same 65,536 pairs in four
passes.
Extrude & Bevel, Revolve, Inflate and Rotate take render.mode "rendered",
with quality (low, medium or high: 1, 2 x 2 or 3 x 3 samples a pixel),
resolution (null for Document Raster Effects Settings, or 1 to 2400 ppi)
and background (transparent or white). The effect then draws its solid
as one image made with craft-raster3d: a depth buffer, the effect's
lights in linear light with the material's roughness and metallic, and
shadow maps for each light, over the effect's vector shadow. The image
lies where the vector faces lie: each mesh point goes through the
projection the effect draws its faces with (MeshProjection).
The shaded faces are drawn instead, and the status bar and the
effect.apply and effect.setParams results carry a "warning", when the
image would pass 16,777,216 pixels at one sample a pixel, or when the
solid is painted with a gradient, a pattern, graphics, an opacity below
100% or a blending mode other than Normal, and for Revolve on a group or
on a fill or stroke. The warning check measures the image without
rasterizing it.
The 3D and Materials panel's Render Settings menu gains Rendered and Low,
Medium and High Quality. Each choice is one undo step for the selection,
and each object keeps its other render settings.
The effect-art cache now includes the document's raster resolution, so
changing Document Raster Effects Settings redraws rendered images.
Every craft-libs rev moves to 64383b59, which adds crates/raster3d.
Docs: docs/three-d.md, docs/mcp.md, docs/target-app-parity.md.
Extrude & Bevel, Revolve, Inflate and Rotate take a `material` parameter,
{roughness, metallic}, each a number from 0 to 1 (defaults 1 and 0). The
3D and Materials panel's Materials tab shows them under Properties as two
sliders; each change is one undo step for every selected 3D object. A
value the selected objects hold differently is shown blank with its reset
dot filled, and a typed or dragged value or a reset sets it on all of
them while each keeps its own value of the other property.
- The default material draws exactly as before and calls no BRDF.
- Any other material is shaded through craft-pbr with the glTF 2.0
metallic-roughness BRDF (Appendix B, with the separable Smith
visibility of B.3.2) for each light and a split-sum environment scaled
by Ambient Light. The reflected light is screened over each face as
vector gradient ramps; graphics on a side or on Inflate's faces lie
under it, and graphics on caps and the plane take the cap's mean
reflected light in their colors.
- Smoothed bevel bands take the normals they share at their edges and
draw as two triangles, so neighboring bands meet without a step, with
perspective and twist too. A bevel whose split bands would pass the
solid's face limit keeps one facet per band, so a material never makes
a solid that draws with the default material too complex. Wireframe
mode draws the same edges for every material.
- A gradient with transparent stops stays transparent: the faces are drawn
opaque under one mask of its coverage. A pattern surface takes no
highlight.
- glTF exports write roughnessFactor and metallicFactor, and USD exports
write inputs:roughness and inputs:metallic (when it is not 0). OBJ's
MTL writes neither, so parts of one color and picture share one OBJ
material as before.
- A material that is not an object, an unknown key, or a value that is not
a number from 0 to 1 is refused; the 3D (Classic) effects take none. A
loaded material that fails these rules draws as the default.
Docs: docs/three-d.md (Material properties; the Inflate graphics text is
corrected; the Properties are listed as built), README, docs/mcp.md,
docs/effects-parity.md, docs/target-app-parity.md, ROADMAP.
The test counter in RingFinder::reach now counts one entry per read in the compaction loop. docs/three-d.md says that past the limit a face that can go next still goes, and the first face left by depth goes next only when none can.
MAX_LOCAL_CHECKS's doc comment said pairs not reached keep their depth order; an uncompared pair adds no constraint, and past the step limit the first face left by depth goes next only when no face can. a_list_longer_than_the_room_left_is_not_read now asserts how many list entries are read at each room size, and fails when an over-long list is counted as read.
object.distort gave type and symbol instances the warp's affine
approximation at their center, so their corners missed the handles.
They now keep their art and are drawn through the warp, composed after
any projection they had, as type and symbols on the Perspective Grid
are. Corners that would fold the box, cross the warp's horizon or lie
too close together for a perspective map are refused with an error that
names the object.
Images in the art of a symbol drawn through a projection now have their
corners placed by it, and their linked masks are projected with them.
Before, they stayed flat while the rest of the art moved.