Commit Graph
925 Commits
Author SHA1 Message Date
.CooCoo 3a6e384f45 Merge pull request #10459 from dotCooCoo/fix/halftone-grid-styles
Vector Halftone: add Grid, Grid Angle, Grid Dots and Grid Dots Angle styles
2026-12-03 07:26:20 -08:00
.CooCoo 7a14274d56 Merge pull request #10211 from dotCooCoo/feat/vector-3d-materials
3D: Roughness and Metallic on the Materials tab shade and export the surface
2026-12-03 07:21:12 -08:00
dotCooCoo 5d784fb626 Merge main into fix/halftone-grid-styles 2026-12-02 15:15:55 -08:00
dotCooCoo c679af091d Vector Halftone: write each round dot with four curves again
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.
2026-12-02 13:31:19 -08:00
dotCooCoo d41bf48738 Vector Halftone: round dots inside the cell keep four anchors
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.
2026-12-02 06:19:35 -08:00
dotCooCoo f902da5d30 Merge main into feat/vector-3d-materials 2026-12-02 02:25:15 -08:00
dotCooCoo c58415b307 Tests: color and effects tests check behavior, not their own tables
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.
2026-12-01 17:24:39 -08:00
dotCooCoo 9c26334a4a Vector Halftone: unknown styles keep Shape and Angle; refuse a non-string style
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.
2026-12-01 14:12:51 -08:00
.CooCoo 4596f1a8be Merge pull request #10374 from dotCooCoo/fix/swallowed-regression-guards
Tests: guards check the environment, not the output under test
2026-12-01 14:10:23 -08:00
dotCooCoo 1b7cde01de Vector Halftone: full-tone dots fill the cell; Style picker shows any stored case
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.
2026-12-01 13:40:15 -08:00
dotCooCoo 193034f469 Vector Halftone: refuse unknown live styles; join dot quadrants cleanly
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.
2026-12-01 12:13:48 -08:00
.CooCoo eb8e3b41bd Merge pull request #10452 from dotCooCoo/fix/halftone-merged-dot-edges
Vector Halftone: round and diamond dots stay in their cell, so dark tones join cleanly
2026-12-01 10:49:12 -08:00
dotCooCoo 5c907ae60f Vector Halftone: Grid Dots styles use the cell-clipped Circle dot
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.
2026-12-01 06:54:15 -08:00
.CooCoo 32dca73ec1 Merge pull request #10432 from dotCooCoo/fix/test-tolerances-render-effects-brush
Tests: exact expectations for gradients, brush pressure, Smart Blur and effects
2026-12-01 06:39:09 -08:00
dotCooCoo 4f44d6469e Merge fix/halftone-merged-dot-edges into fix/halftone-grid-styles 2026-12-01 06:02:50 -08:00
dotCooCoo 926959780c Merge main into fix/halftone-grid-styles 2026-12-01 06:02:50 -08:00
dotCooCoo a6a0f3361f Vector Halftone: add Grid, Grid Angle, Grid Dots and Grid Dots Angle styles
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.
2026-12-01 06:02:49 -08:00
e28faa0a94 Color Halftone: draw dark dots on light tones (#10316)
* 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]>
2026-12-01 14:17:04 +01:00
dotCooCoo b26f833acf Vector Halftone: round and diamond dots stay in their cell
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.
2026-12-01 04:37:05 -08:00
dotCooCoo 72b0bdad60 Tests: Smart Blur checks hand-calculated pixels at radius 2 and 12
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.
2026-12-01 03:17:36 -08:00
dotCooCoo e14ee70326 Tests: exact expectations for gradients, brush pressure, Smart Blur and effects
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).
2026-12-01 01:53:59 -08:00
dotCooCoo 85ad10feb5 Vector Halftone: Euclidean quadrant uses the shared arc and segment helpers
quadrant() had local closures that repeated ellipse_arc() and segment().
It now calls those helpers, as elliptical_quadrant() does. The geometry
is unchanged.
2026-11-30 22:32:07 -08:00
dotCooCoo 1dbbf87436 Tests: guards check the environment, not the output under test
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.
2026-11-30 21:56:24 -08:00
dotCooCoo 0a4fcb67ae Vector Halftone: Elliptical dots bridge along their length from 40%
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.
2026-11-30 21:27:14 -08:00
dotCooCoo b143f92f3f Vector Halftone: Euclidean and Elliptical dot shapes
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.
2026-11-30 20:49:40 -08:00
dotCooCoo 86a036f724 Merge main into feat/vector-3d-materials 2026-11-30 15:37:03 -08:00
dotCooCoo 7aee17deaa Tests: the 3D face-limit and gray-level smoothing tests check the same cases with small inputs
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.
2026-11-30 05:25:15 -08:00
dotCooCoo 6866aa8190 3D: Roughness and Metallic on the Materials tab shade and export the surface
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.
2026-11-29 23:32:57 -08:00
.CooCoo 79a3805b1d Merge pull request #9957 from dotCooCoo/train/carry8496
3D: a ring of overlapping faces is broken at one of its own faces
2026-11-28 16:06:32 -08:00
dotCooCoo 16c63fdec9 Merge main into feat/distort-text-symbols 2026-11-28 14:28:32 -08:00
dotCooCoo 6f36d55234 Merge main into train/carry8496 2026-11-28 13:51:41 -08:00
dotCooCoo 4278fffdb5 3D: count each list entry where it is read, and say what goes next past the step limit
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.
2026-11-28 09:55:05 -08:00
dotCooCoo 6d0408fd07 3D: say what an uncompared pair does in the sort limit's doc, and test the exact entries read
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.
2026-11-28 09:36:04 -08:00
dotCooCoo 2f1d7a2c8d Merge main into train/carry8496 2026-11-28 09:14:09 -08:00
dotCooCoo d07eaa1699 Merge main into train/carry8285
# Conflicts:
#	crates/engine/src/cmd/stroke.rs
#	docs/target-app-parity.md
2026-11-28 08:54:16 -08:00
dotCooCoo 5ff876c327 Free Transform: Perspective Distort and Free Distort put type and symbol instances' corners on the handles
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.
2026-11-28 03:12:46 -08:00
.CooCoo 3c7a3c7904 Merge pull request #9881 from dotCooCoo/fix/stroke-hit-cap-dots
Strokes: a click on the dot a round or projecting cap draws for a lone anchor hits the path
2026-11-28 00:48:03 -08:00
.CooCoo a949db79fe Merge pull request #9137 from dotCooCoo/feat/plugin-api-live-effect-appearance
Plug-ins: live effects set opacity, blending and effects on their pieces
2026-11-28 00:46:29 -08:00
dotCooCoo ff02d3c23d Effects: each copy of a painted piece carries its own raster effects
When a live-effect plug-in returned a piece whose effects list a raster
effect before a Transform effect that makes copies, the Transform effect
copied the bare geometry and the raster effect was drawn once around all
of the copies. dress_piece applied the piece's geometry effects to its
geometry alone and kept every raster effect on the group around them.

dress_piece now builds such a piece through copied_raster_art, as an
object's copies are built: each copy carries its own raster effects,
moved, turned, reflected and scaled with it. copied_raster_art takes an
optional budget and completion flag, so the piece still keeps to the room
it is given and is refused when its copies or its geometry effects would
stop short. The piece's fills and strokes keep their own effects for
their own stage.
2026-11-27 23:49:41 -08:00
dotCooCoo dc2f212acd Strokes: a click on the dot a round or projecting cap draws for a lone anchor hits the path
A round or projecting cap draws a dot for a subpath that never leaves
its first point: a closed lone anchor, or a line or curve back to the
same point. StrokeLayer::hits ruled the click out by the box of the
segments, which leaves out a closed lone anchor, and then measured
only segments with length, so a click on the dot missed. The fast
path for a plain centered stroke in hit_leaf also returned no hit for
a path whose only subpath is a closed lone anchor.

hits now measures each such subpath as the dot the stroke draws: a
disc for a round cap and an axis-aligned square for a projecting cap,
as wide as the stroke's body, on undashed strokes without a width
profile, which are the strokes that draw a dot. Inside and outside
strokes keep to their side of a closed path. Butt caps draw no dot
and still miss. The fast path hands a click near a closed lone anchor
to the full check.

Hover, Select Behind, Direct Selection and the Eyedropper go through
the same hit test, and a marquee over the anchor already selects it.
2026-11-27 23:30:58 -08:00
dotCooCoo 41eef74720 Effects: geometry effects work from bounds that hold lone anchors
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.
2026-11-27 23:16:54 -08:00
dotCooCoo 5a771c52f7 Merge main into feat/plugin-api-live-effect-appearance 2026-11-27 22:50:09 -08:00
.CooCoo 57be40f876 Merge pull request #9787 from dotCooCoo/fix/pathdata-bounds-lone-anchors
Paths: a subpath of one anchor counts in the path's bounds
2026-11-27 21:43:57 -08:00
dotCooCoo baad987df5 Tests: complexity tests count work instead of timing it
Eight tests in effects, brush, tools and trace bounded their run time
with Instant::elapsed. Each now counts the work the bounded code does
and asserts that count instead:

- effects: the subpaths Offset Path offsets after Transform copies
  move behind it (1 for the rectangle, 5 for five leaves)
- brush: the calls a misbehaving bend map gets, at most what the
  fitting depth and the chord count allow
- tools: the points Liquify's simplify measures (five per anchor) and
  the anchors it moves (one each), and the objects the eyedropper's
  hit tests may visit (within the work limit)
- trace: the named logo colors compared with those kept (ten per
  color), the lookups that drop repeated swatches (one each) and the
  swatch colors compared with the picture's colors (each distinct
  swatch once per color)

Each count fails when the bounded step is removed or made to repeat.
2026-11-27 17:58:50 -08:00
dotCooCoo 5c709a1a64 Paths: painted boxes leave out lone anchors a fill does not paint
PathData::bounds now counts a subpath of one anchor, so three places
that measure what a path paints measured a point nothing paints:

- .ai import: the box arrowheads are placed against measured a visible
  fill by the path's geometric box. A filled path with a head and one
  stray anchor no longer fit the drawn look, so its style was not read.
  The fill now measures PathData::drawn_bounds(false).
- Type copies a Transform effect moves: the ink box of the glyph
  outlines now counts a contour of one anchor only where a round or
  projecting character stroke cap draws it as a dot.
- .ai envelopes: a piece of type outlines made only of contours of zero
  length kept them and counted their point. It now counts nothing, as
  the rule for such contours says.

Tests: a filled line with a head and a stray anchor still fits a look
of the line and its head; a dot-only piece beside a stroked square adds
nothing to the square's box. Both fail without the change.
2026-11-27 16:44:42 -08:00
BFlat df909b69e0 Merge pull request #8984 from dotCooCoo/fix/feather-effect-history-name
History: effect steps take the effect's name from the Effect menu
2026-11-27 05:12:25 +07:00
dotCooCoo acda8bed27 Effects: restore the blend-mode menu for shadows and glows
Use the grouped picker in the effect dialogs and Appearance editor. Validate new automation requests while preserving earlier spellings, recorded steps, and untouched stored modes.
2026-11-26 07:07:41 -08:00
dotCooCoo 1fb8202f67 Merge main into feat/plugin-api-live-effect-appearance 2026-11-25 18:37:06 -08:00
dotCooCoo c64d194a4d Merge main into fix/pathfinder-effect-options-followup 2026-11-25 14:43:59 -08:00
dotCooCoo 98605b8651 Merge main into fix/feather-effect-history-name 2026-11-25 04:24:09 -08:00