Offer a mask that is nothing but a hand

Every route to a layer began with a selection — a gradient, a band, a subject,
a category — and painting was reachable only by making one of those and
joining a painted part to it. So the answer to "brush a correction onto this
corner of the sky" was "add a radial gradient you do not want, then paint into
that", which is not an answer.

Paint sits beside Linear and Radial and makes a layer whose base is a brush.
It covers nothing until a stroke lands in it, so pressing it arms the brush
and shows the mask as well: a row that appeared and changed no pixel, with the
pointer still in "select", is indistinguishable from a button that did nothing.
This commit is contained in:
2026-09-10 20:28:09 +02:00
parent c045702a47
commit 76ad667fd6
3 changed files with 78 additions and 0 deletions
+31
View File
@@ -3434,6 +3434,37 @@ impl DevelopSession {
Some(id)
}
/// TRACES: FR-DEV-19b
/// Add a mask that is nothing but hand-painted, and select it.
///
/// **The one route to a brush that starts from nothing.** Everything else
/// in this file makes a layer out of a selection — a gradient, a band, a
/// subject, a category — and painting was reachable only by making one of
/// those first and then joining a painted part to it. So the answer to
/// "brush a correction onto this corner of the sky" was "add a radial
/// gradient you do not want, then paint into it", which is not an answer.
///
/// The layer covers nothing until a stroke lands in it, which is exactly
/// what [`dr_pipeline::mask::MaskPart::covers`] is about: it is not active,
/// it costs no slice, and an invert on it would not take the adjustment
/// global. What the panel shows meanwhile is a row with the tools armed
/// over it — see `masks_ui`, which arms them.
pub fn add_brush_mask(&mut self) -> Option<String> {
let id = self.graph.masks().next_id();
if !self
.graph
.masks_mut()
.push(MaskLayer::new(id.clone(), MaskSource::brush()))
{
return None;
}
self.active_masks = vec![id.clone()];
self.active_part = 0;
self.history
.record(&self.graph, Edit::Action(labels::step::MASK_ADDED));
Some(id)
}
/// TRACES: FR-DEV-10
/// Add a mask that selects by a range of the photograph's own values.
///