mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-12 00:41:42 +00:00
* Eraser: add Erase to History (Brush, Pencil and Block modes) Photoshop's Eraser has an Erase to History option; PhotoCraft had only the History Brush. With it ticked, the Eraser paints the History panel's source state back instead of erasing, through paint.historyBrush with eraseToHistory. Pencil and Block modes paint back through their hard tips. A layer that did not exist in the source state paints that state's visible image; the History Brush itself still refuses such a layer, as Photoshop's does. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Keep tool_event within clippy's complexity limit * Test Erase to History at every depth and tip * Update the History Brush params comment for Erase to History * Erase to History paints a layer made since only from a single-layer state Compared with Photoshop 27.11.0: on a layer the source state does not hold, Erase to History paints when that state holds a single layer, Background or not, and gives an error when it holds a second layer, even an empty one. The composite of a multi-layer state is gone; those states now refuse the layer with the History Brush's error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Erase to History paints a single source layer's own pixels Photoshop 27.11.0 paints a layer made since with the source layer's pixels: a 50% opacity layer gives a solid stroke, where the composite gave a faded one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Erase to History: Pencil mode paints at full flow; test a group-only source state Pencil mode has no Flow control, so a lower Flow set in Brush mode must not carry over. A source state holding only a group has no pixels of its own and refuses a layer made since. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Erase to History keeps its options if a tool key is pressed mid-stroke The stroke read the current tool and brush when it was committed, so pressing a tool's letter during the drag dropped eraseToHistory and the stroke failed on a layer made since. The options and the Eraser's tip are now captured at the press. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Erase to History: a single solid shape paints its colour; name the History row Photoshop 27.11.0 paints a shape layer's solid colour along the whole stroke, past its path, and calls the stroke History Eraser in the History panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Erase to History: a single shape without a solid fill paints white Observed in Photoshop 27.11.0: a gradient, pattern or no fill paints plain white along the whole stroke, past the path and whatever the outline, in RGB, CMYK, Grayscale and Lab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Eraser: Alt at the press reverses Erase to History for that stroke As in Photoshop 27.11.0: with the option off Alt restores, with it on Alt erases. Alt pressed or released during the stroke changes nothing, and the option itself is left as it was. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Erase to History: name the Photoshop version compared Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Erase to History: review fixes for the error and the History Brush tip A layer without pixels now gets the error that the target did not exist in that history state, not "no active document". The History Brush keeps its size, hardness and spacing from the press, as the Eraser does, if a tool key is pressed mid-stroke. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Brush parity: add the Eraser's Erase to History Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Erase to History: document the functions this change touches Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * History Brush and Erase to History keep their whole brush from the press Only mode, opacity, flow, size, hardness and spacing were kept from the press; the rest of the brush (tip shape, sampled tip, angle, dynamics, smoothing) came from the session brush at release. A tool key mid-stroke changed that brush, the commit rejected the live preview, and the fallback repainted the whole stroke with the new tool's brush. The stroke's params now carry the press-time brush as "brush" (stored tips as references, as each tool's remembered brush), and paint.historyBrush deep-merges it onto the session brush, so the live preview, the commit, its fallback and a replayed action all paint with it. Tests: a tool switch mid-stroke paints exactly what the same stroke paints without it, for the History Brush and Erase to History in Brush, Pencil and Block mode, across tip shape, sampled tips, dynamics and smoothing; a "brush" param paints as the session brush would; a malformed one is refused. * History Brush docs: say "outside its shape", not "past its path" The automation crate flags any command whose params text mentions a path as a possible filesystem path (registry_filesystem_path_params_are_classified); the eraseToHistory description meant a shape's vector outline. Also a test that a state whose one root item is a group of several layers is refused like the one-layer group: a group has no pixels to paint back. * Test that a Shift-click Erase to History line commits its live pixels unsmoothed Main's Shift-click fix (#11887) and this branch's press-time History Brush params meet in finish_stroke_with; check the commit sends smoothing 0 beside the brush param in all three Eraser modes. --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>