Commit Graph
620 Commits
Author SHA1 Message Date
autocraft-bot[bot] 143825b807 Merge pull request #16115 2026-12-01 15:26:27 +00:00
autocraft-bot[bot] edfdfeafe9 Merge pull request #17436 2026-12-01 15:26:27 +00:00
autocraft-bot[bot] 91bf9f75d2 Merge pull request #15411 2026-12-01 15:26:27 +00:00
David MannandClaude Opus 5.5 4dd8ef1920 Batch fix-up: Place Along Path fit, reach and tile limit (CodeRabbit on #18551)
- Fit and the end of the path use how far a tile reaches along the path: an upright tile on a vertical path ends 15 px
  past its centre for the 40 x 30 probe, not 20.
- Fit stretches the steps only as far as every tile still ends at or before the path's end, so shrinking tiles (Scale
  progression below 100 %) no longer reach past it.
- Tiles out of reach of the painted area are skipped (a run at a steady size in one jump) and keep their number and
  place, so spacing, progression and mirroring stay as on the whole path: a path starting far off the canvas no longer
  spends the tile limit there and paints nothing.
- A path that needs more than the 100,000-tile limit over the area is refused with a message, rather than filled part
  of the way and reported as done.
- The per-tile colour drift is worked out once per tile, not per pixel.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 03:46:21 +01:00
David MannandClaude Opus 5.5 289fe5cc14 Batch fix-up: Symmetry Fill dilations are the same for any selection on the canvas (CodeRabbit on #18551)
The range of dilation steps came from the painted rect, so a small selection dropped enlarged copies that still cover
it (a translucent tile's centre pixel changed), and type 6 numbered its copies from the largest step, so the same copy
drifted to another colour when the range changed. The range now comes from the canvas (with the area), and dilated
copies take their own step as the number for the colour drift; the drawing order stays as it was.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 03:46:21 +01:00
David MannandClaude Opus 5.5 f84e580ebb Batch fix-up: Random Fill along a path ignores the parts out of the area's reach (CodeRabbit on #18551)
A long subpath far off the canvas took nearly all the tiles (and swamped the visible line's share of the arc length),
so the visible line got none. The path's pieces are now clipped to the area grown by Max distance and the largest
tile's reach before the tiles are spread over them; without a path nothing changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 03:46:21 +01:00
David Mann 6daf9b92a1 Merge PR #18400 at its new head: Fill: Spiral script pattern (#17432) 2026-12-01 00:44:11 +01:00
David MannandClaude Opus 5.5 4d4324155f Fill: Spiral reaches the covering tiles in the tightest packings (#17432)
Each turn of the spiral now offers only the tiles within reach of the
pixel, found by the law of cosines over the turn's radius band, and the
turns are walked lazily from the outside in. Past the try limit the
topmost tile whose centre lies within half the tile's shorter side,
which covers the pixel however it is turned, stands in, so a covered
pixel is never left transparent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 00:41:19 +01:00
David Mann 79f18d531c Merge PR #18396: Fill: Symmetry Fill script with 33 symmetry types (#17433)
# Conflicts:
#	crates/compose/src/scripted_pattern.rs
#	crates/engine-paint/src/cmd/fill_cmds.rs
#	crates/engine-paint/src/fill_script_brick_tests.rs
#	crates/engine-paint/src/lib.rs
#	crates/ui-egui/src/dialogs/fill_script_ui.rs
2026-12-01 00:33:46 +01:00
David Mann a9e76540b6 Merge PR #18401: Fill: Place Along Path scripted pattern (#17430)
# Conflicts:
#	crates/compose/src/scripted_pattern.rs
#	crates/engine-paint/src/cmd/fill_cmds.rs
#	crates/engine-paint/src/fill_script_brick_tests.rs
#	crates/engine-paint/src/lib.rs
#	crates/ui-egui/src/dialogs/fill_script_ui.rs
#	crates/ui-egui/src/dialogs/fill_script_ui_tests.rs
2026-12-01 00:18:15 +01:00
David Mann 0d525b369c Merge PR #18400: Fill: Spiral script pattern (#17432)
# Conflicts:
#	crates/compose/src/scripted_pattern.rs
#	crates/engine-paint/src/cmd/fill_cmds.rs
#	crates/engine-paint/src/fill_script_brick_tests.rs
#	crates/engine-paint/src/lib.rs
#	crates/ui-egui/src/dialogs/fill_script_ui.rs
#	crates/ui-egui/src/dialogs/fill_script_ui_tests.rs
2026-12-01 00:00:36 +01:00
David Mann c2dd8262d8 Merge PR #18398: Fill: Random Fill script (#17431) 2026-11-30 23:55:22 +01:00
David Mann 03934fd0d9 Merge PR #13855: Gradient Fill layers and Gradient Overlay keep Photoshop's gradient 2026-11-30 23:55:19 +01:00
David Mann 8c79de580b Merge remote-tracking branch 'origin/main' into fix/17432-fill-script-spiral
# Conflicts:
#	crates/compose/src/scripted_pattern.rs
#	crates/engine-paint/src/cmd/fill_cmds.rs
#	crates/engine-paint/src/fill_script_brick_tests.rs
#	crates/engine-paint/src/lib.rs
#	crates/ui-egui/src/dialogs/fill_script_ui.rs
#	crates/ui-egui/src/dialogs/fill_script_ui_tests.rs
2026-11-30 23:47:57 +01:00
David Mann d4c2ffa00e Merge main into fix/17431-fill-script-random-fill
# Conflicts:
#	crates/compose/src/scripted_pattern.rs
#	crates/engine-paint/src/cmd/fill_cmds.rs
#	crates/engine-paint/src/fill_script_brick_tests.rs
#	crates/engine-paint/src/lib.rs
#	crates/ui-egui/src/dialogs/fill_script_ui.rs
#	crates/ui-egui/src/dialogs/fill_script_ui_tests.rs
2026-11-30 23:34:11 +01:00
David Mann 8b72b67fc8 Merge pull request #18397 from davidmann4/fix/17429-fill-script-cross-weave
Fill: Cross Weave script (#17429)
2026-11-30 23:28:23 +01:00
David MannandClaude Opus 5.5 7d75b77f71 Fill: Place Along Path scripted pattern (#17430)
Edit > Fill > Pattern > Script > Place Along Path lays the pattern tile
along the path selected in the Paths panel: tiles centred on the path,
the first on the start point, turned with the path, a step of the tile's
shorter side plus Spacing apart, placed while they end before the path
does, every other tile mirrored with Alternate patterns. The dialog has
the 10 controls with their check boxes and greying rules; without a
selected path the fill is refused with "No path selected" and the dialog
does not open. Path sampling by arc length lives in the vector crate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 23:03:00 +01:00
David MannandClaude Opus 5.5 391cc3ca20 Fill: Symmetry Fill script with 33 symmetry types (#17433)
Fill > Pattern > Script > Symmetry Fill repeats the pattern tile about the
canvas centre (the selection's centre with one) by one of 33 symmetry
types: line and point reflection, 4-fold rotation, translation, glide
reflection, four dilations, the seven frieze groups and the 17 wallpaper
groups. Type 1 matches the measured two mirrored tiles; the factory P6M
fills the area with 6-fold turned and mirrored copies.

The scripted-pattern module gets one render dispatch that edit.fill and
the dialog preview share; the script dialog gets the Symmetry type list
and the translation rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 22:36:01 +01:00
David MannandClaude Opus 5.5 67f8cdb202 Fill scripts: tiles clear at a pixel do not use up the layer limit (#17429)
A tile that covers a pixel but is transparent there counted toward the
1024-layer cap, so with a mostly clear pattern at the largest overlap the
cap ran out before the tiles that show at that pixel were reached and the
pixel stayed empty. Only visible samples count now; a separate, larger
visit cap keeps the work per pixel bounded. Applies to Brick Fill and
Cross Weave alike.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 22:27:43 +01:00
David MannandClaude Opus 5.5 dc26febbc2 Fill: name the Random Fill path segment type for clippy (#17431)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 20:32:50 +01:00
David MannandClaude Opus 5.5 965aebff55 Fill: Cross Weave script (#17429)
Edit > Fill > Pattern > Script > Cross Weave weaves the pattern tile in a
basket weave: square cells of the mean tile side plus Spacing alternate
between a flat and an upright tile like a checkerboard, leaving a 5 x 5
transparent hole at every 35 px grid point for a 40 x 30 tile, each tile
turned half way or not at random (repeatable by seed). edit.fill and the
dialog preview both lay scripts out through one render() in
scripted_pattern.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 20:16:39 +01:00
David MannandClaude Opus 5.5 499bf6089f Fill: Spiral script pattern (#17432)
Fill > Pattern > Script > Spiral lays the pattern tile along a spiral
around the canvas centre: rings one tile height plus Ring spacing apart,
tiles one tile width plus Pattern spacing apart along the curve, turned
with the curve unless Keep pattern upright is on. The script dialog gets
check box rows, and one render entry point serves the engine and the
preview for every script.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 20:09:34 +01:00
David MannandClaude Opus 5.5 5b860fe375 Fill: Random Fill script (#17431)
Random Fill scatters the pattern tile at random places, sizes (between
the two scale factors) and, with Rotate pattern on, angles over the fill
area, or within Max distance of the selected path. edit.fill takes the
Paths panel selection as `path`; the script dialog greys Max distance
from path without one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 19:39:40 +01:00
David Mann 86a13c1145 Merge #10431 into the merge queue batch
Tests: CMYK proptest regression seeds run again
2026-11-30 18:27:42 +01:00
David Mann 06415bb6a5 Merge remote-tracking branch 'origin/main' into fix/17428-fill-script-brick-fill
# Conflicts:
#	crates/engine-paint/src/cmd/fill_cmds.rs
#	crates/engine-paint/src/lib.rs
2026-11-30 17:34:17 +01:00
David Mann a14f81d900 Merge #17341 into the merge queue batch
fix(compose): honour Anti-aliased for a Gaussian or Ring Satin
2026-11-30 10:38:22 +01:00
David MannandClaude Opus 5.5 aead9765f6 Brick Fill: bound tiles at the scale the placement samples with
The tile extent now uses the pattern scale rounded to f32, as Placement maps
with, so a pixel on a scaled tile's edge is found and painted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 00:57:45 +01:00
David MannandClaude Opus 5.5 9bc82e63bf Brick Fill: find every tile that covers a pixel; keep exact colours at zero drift
Each row's covering tiles are now worked out from the turned tile rectangle
around the pixel, so no covering tile is skipped behind far-away candidates;
the work limit counts only tiles composited into the pixel. Without a colour
or brightness drift a tile keeps its colour unclamped (float patterns past 1).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 00:46:37 +01:00
David MannandClaude Opus 5.5 a3248ceac0 Fill: Script option with Brick Fill (#17428)
Fill > Pattern gets a Script check box and list (Brick Fill, Cross Weave, Place
Along Path, Random Fill, Spiral, Symmetry Fill). OK with Script on opens the
script's dialog: live preview, Preset (Default / Custom), a field and slider
per value, OK / Reset / Cancel. edit.fill takes `script` and the script's
values; Brick Fill lays the pattern out in rows with every second row shifted.
The other five scripts answer "not supported yet".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-29 23:14:09 +01:00
FredApps a3288779f1 Reuse cached text bounds during layer picking (#17584)
* Reuse cached text bounds during layer picking

* Scan cache misses outside the bounds lock and respect concurrent Purge
2026-11-29 09:49:11 +01:00
qvest-ssels eef4dadc22 Inner Glow noise: keep the shared law for Source Center and Precise (#14926)
Only Softer with Source Edge was measured. The issue's rules keep today's
behaviour for unmeasured cases, so the square root now applies to that
case alone.
2026-11-28 23:35:22 +01:00
qvest-ssels 86f431d177 fix(compose): scatter Inner Glow noise at the measured strength
Fixes #14926. The shared effect-noise law (#15188, #15197) leaves 244 of the
issue's 1620 band pixels without glow at Noise 50; the reference application
shows 343. Inner glows now feed the law the square root of Noise, which keeps
Noise 0 and Noise 100 unchanged and gives 342 px at Noise 50. Outer Glow and
both shadows keep the shared law.
2026-11-28 19:02:19 +01:00
qvest-ssels f9e1c2fa42 fix(compose): honour Anti-aliased for a Gaussian or Ring Satin (#14984)
An Anti-aliased Satin with the Gaussian or Ring contour takes both of its
shifted copies from the shape a third of a pixel towards the top-left
(satin_aa_shift), the offset the Inner and Drop Shadow measured: the whole
pattern moves up, its Distance stays. Linear, unmeasured contours and
Sizes whose blur is the identity keep today's map bit-for-bit. The GPU
satin builder takes the same offset on the same gate.
2026-11-28 17:01:26 +01:00
qvest-ssels 5ec2e5a7a9 fix(compose): honour Anti-aliased for the Drop Shadow map (#14881)
The Drop Shadow now takes the same third-of-a-pixel source offset the
Inner Shadow takes since #14934, through the same aa_shift gate (Gaussian
contour, no dilating Spread, a blur wider than the identity), on the CPU
(shadow_map) and the GPU map program (B::shadow). On the issue's document
the edges land within 2 levels of the measured profiles; the flag off
keeps every map bit-for-bit.
2026-11-28 16:54:44 +01:00
David Mann 3597c13275 Merge #15766 into the merge queue batch
Cover translucent raster pixels with Inside and Center strokes (#15002)
2026-11-27 12:08:38 +01:00
qvest-ssels f4fe8e0bc1 Merge main into fix/gradient-fill-overlay-source-13557
# Conflicts:
#	crates/engine-core/src/cmd/convert_gradient_tests.rs
#	crates/engine-core/src/cmd/gradient_fill_cmds/source.rs
2026-11-27 11:12:56 +01:00
Dan 9f81f17b2d Use document layer lookup in the cache regression 2026-11-26 18:46:07 +00:00
Dan d2dec04f01 Invalidate group effect maps when a child changes type 2026-11-26 18:27:10 +00:00
qvest-ssels ee10c0804e Color Settings: Blend Text Colors Using Gamma is a checkbox with a 1.00-3.00 field
Blend Text Colors Using Gamma was a 1.0 to 2.2 slider where 1.0 meant off, so turning it off and on lost a custom value. ColorSettings now keeps the field's value (blend_text_gamma, 1.00 to 3.00, two decimals) and the box (blend_text_gamma_on) apart; text_gamma() is what the compositor blends in (1 while the box is off), and the compositor takes up to 3.00. edit.colorSettings still takes a bool for blendTextGamma (the box alone) or a number in range (the value, and the box checked), plus blendTextGammaOn. The dialog shows the checkbox with the field beside it: typing a value checks the box, focusing does not, an out-of-range value alerts "A number between 1.00 and 3.00 is required. Closest value inserted." and an emptied field puts its value back. Settings saved as one number still load: 1 as the box off with 1.45, any other value as the box on with that value (#14243).
2026-11-26 17:22:41 +01:00
David Mann 44c2a2937d Merge #16479 into the merge queue batch
Patterns paint the grey profile's greys in Grayscale documents (#14975)
2026-11-25 17:31:39 +01:00
David Mann b30a4b0bae Merge #16661 into the merge queue batch
Outer Glow: one Range/Size rule for Softer Edge glows (#15871)
2026-11-25 13:28:26 +01:00
David Mann ec236094ca Merge #16638 into the merge queue batch
fix(tools): a pattern from an Indexed image keeps painting (#13071)
2026-11-25 13:28:24 +01:00
David Mann 77b7358fbf Merge #16200 into the merge queue batch
Modern Brightness at +150 and -150 matches the reference ramps (#14348)
2026-11-25 13:28:21 +01:00
RickiNano b1100518a1 Modern Brightness: each input rises with the slider up to ±150 (#14348)
Past +110 the curve mixed the slider's own roll-off with the fixed +150
fit. The power roll-offs come closer to white than that fit past about
input 220, so the mix fell there as the slider neared +150: input 200
gave 253.55 at +134 and 253.32 at +150.

The ease now starts at +109.5, the last Hermite roll-off, which stays at
or below the +150 fit everywhere, and mixes from the roll-off held at or
below the fit. Both parts of the mix then rise with the slider, and the
curve reaches the +150 fit itself at +150, so the measured ramps are
unchanged.

The new test steps the slider one unit at a time from ±100 to ±150 and
checks every 8-bit input; it fails on the previous curve.
2026-11-25 07:06:51 +01:00
RickiNano bab63cc90e Outer Glow: read the floor from the box end taps (#15871)
softer_edge_floor needs only the box end tap and its neighbour, so it
no longer builds the whole tent kernel (quadratic in the Size).
2026-11-24 15:38:28 +01:00
RickiNano f9c6b8b05e Outer Glow: one Range/Size rule for Softer Edge glows (#15871)
The Range 1 % fix from #15311 hardened an outer Softer glow only at
Size 10 / Range 1 %. Other small Ranges and other Sizes still reached
one pixel too far (Range 2: 96, 223 for 125; Size 20 at Range 1:
48, 175, 239 for 93, 201).

An outer Softer Edge glow with Spread 0 and the Linear contour now maps
coverage v through (v - floor) / (levels * (1 - floor)): the Range
rounded to a whole 8-bit level, less the tent's outermost tap when the
blur's box ends in half taps (even Sizes). That gives every measured
pixel of #15871 and #14958 (Range 1, 2, 25, 50, 100 at Size 10; Range 1
at Sizes 5 and 20) within 1 level. The GPU reads the same table through
glow_paint_lut. Inner glows keep today's table.
2026-11-24 14:43:30 +01:00
f2ac09d2ec Fix-up for #11756: Align Edges as the reference application renders it
The PR snapped shapes with a per-edge heuristic (pixel_align.rs, dash-cap tie
rules, a PSD coordinate-frame field threaded through engine, format and caches),
defaulted the option to off, and renamed the existing Rectangle/Triangle
"Align Edges" checkbox to "Snap Bounding Box" next to a second checkbox.

The reference application fits the whole shape at render time: the bounds of
what it paints (fill, or the stroke's outer edge) get a whole-pixel left/top
(a half rounds up) and a whole width/height, and the path is translated and
scaled into that box. Fill and stroke take one transform; curves stay
antialiased; inner edges of several subpaths are not snapped.

- photocraft_vector::align_edges implements that rule; CompiledShape applies it,
  so caches, the compositor, previews and extents agree; the fill/stroke split
  under layer effects starts from the whole shape's transform.
- Removed pixel_align.rs, the rasterizer helpers it needed, the document-space
  drag preview and psd_coordinate_frame (rounding the bounds absorbs the PSD
  quantization it was for).
- One Align Edges checkbox (ToolOptions::align_edges, stored and scripted as
  useAlignedRendering, older align_edges still read) on every shape tool and the
  Pen, on by default and after Reset Tool; it snaps the drag and sets the layer.
- PSD sn2P: written as 1 when on and left out when off, as the reference saves it.
- Dropped the dead path.set param, moved the control-protocol paragraph,
  rewrote docs/pixel-aligned-strokes.md, reverted the unrelated raw, font,
  Cargo and test-harness changes.
- Tests reproduce the measured cases (rectangles at .25/.4/.5/.6/.75, ellipse
  extremes and curve symmetry, 1/2/3 px strokes, rotated rect, Pen triangle,
  two subpaths, toggle off, stored path unchanged, one checkbox, Reset Tool).

Co-Authored-By: superplay2021 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 13:02:42 +01:00
hnoerenberg 818a4a010d feat(doc): patterns record the colour mode they were defined from
Edit > Define Pattern composites the area in the document's pixel format, which stores an Indexed Color document expanded to RGB. Nothing on Pattern said where the tile came from, so a pattern taken from an Indexed image was indistinguishable from an RGB one, and a tool that cares about the difference had nothing to read.

The new field names the source mode. The pixels, the id and what the pattern library lists stay as they were. A pattern read from a file records no source: a .pat or PSD block says what its pixels are, not which document they came from. The library index and .pcraft carry the field, so a defined pattern keeps its source across a restart or a save; files written before it read as no source.
2026-11-24 11:22:16 +01:00
ljkx 1bf4056082 Merge remote-tracking branch 'origin/main' into fix/14975-pattern-grayscale-greys
Main's engine split step 7 moved the paint modules to crates/engine-paint and
the pattern mode tests to the engine crate's tests/it:

- cmd/fill_cmds.rs was deleted from engine-core (git saw no rename): Edit >
  Fill's pattern tile is built in PatternSpace::of_pixels(doc) in
  crates/engine-paint/src/cmd/fill_cmds.rs.
- cmd/paint_cmds.rs followed its rename.
- pattern_mode_tests.rs is crates/engine/tests/it/paint_in_pattern_mode.rs:
  the tests this branch added start from the facade's Session::new(), which
  installs the commands, like the two that moved.

# Conflicts:
#	crates/engine-core/src/cmd/fill_cmds.rs
2026-11-24 01:27:05 +01:00
superplay2021 47790f5e0d Merge latest main and resolve Align Edges conflicts 2026-11-23 21:25:02 +02:00