Let a part be left out of a mask without being taken out of it
A layer built from parts was missing the one control a correction most often wants: seeing what it did. The question a subtracted gradient raises is whether it took only the sky, and the question a stroke raises is whether it filled the shoulder — and the only way to ask either was to remove the part and look, which answered the question and lost the part. The layer's own ring answers a different question, about the adjustment, and hiding eight layers to check one correction is not an A/B anybody performs. So a part carries `hidden`. It is an edit and a history step, as the layer's switch is, and it is folded into the render fingerprint because hiding a part changes the mask as surely as removing it does. Where the mask is built the shown parts are walked rather than the parts, which is what makes a hidden base hand the fold to the first part that is shown — and a revealed layer whose every part is hidden clears its slice rather than leaving whatever the last rasterisation put there to be read back. `covers` asks the same shown parts, so a layer whose only adding part is hidden costs no slice at all. In the sidecar the key is `hidden`, in the part's block or, for the base, in the mask block — under a word that cannot be confused with the layer's `enabled`, which has always meant the layer. Absent means shown, so no file written before the switch existed reads any differently. The row wears the same ring the layer does, one row down, because it is the same question about a smaller thing.
This commit is contained in:
+21
-2
@@ -2938,7 +2938,7 @@ impl DevelopSession {
|
||||
/// The join of the first is meaningless — there is nothing before it to
|
||||
/// join to — and the panel shows it as the selection the layer *is*
|
||||
/// rather than as a row with a chip that does nothing.
|
||||
pub fn mask_parts(&self, id: &str) -> Vec<(String, String, usize)> {
|
||||
pub fn mask_parts(&self, id: &str) -> Vec<(String, String, usize, bool)> {
|
||||
let Some(layer) = self.graph.masks().get(id) else {
|
||||
return Vec::new();
|
||||
};
|
||||
@@ -2950,11 +2950,30 @@ impl DevelopSession {
|
||||
.iter()
|
||||
.position(|&j| j == p.join)
|
||||
.unwrap_or(0);
|
||||
(p.id.clone(), p.source.kind().to_string(), join)
|
||||
(p.id.clone(), p.source.kind().to_string(), join, p.hidden)
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// TRACES: FR-DEV-19a
|
||||
/// Leave one part out of the build, or put it back. An edit, and one
|
||||
/// history step, for the same reason the layer's own switch is: the part
|
||||
/// really is out until it is switched back.
|
||||
pub fn set_mask_part_hidden(&mut self, id: &str, index: usize, hidden: bool) {
|
||||
let Some(layer) = self.graph.masks_mut().get_mut(id) else {
|
||||
return;
|
||||
};
|
||||
let Some(part) = layer.part_mut(index) else {
|
||||
return;
|
||||
};
|
||||
if part.hidden == hidden {
|
||||
return;
|
||||
}
|
||||
part.hidden = hidden;
|
||||
self.history
|
||||
.record(&self.graph, Edit::Action(labels::step::MASK_PART_TOGGLED));
|
||||
}
|
||||
|
||||
/// TRACES: FR-DEV-19a
|
||||
/// Join a fresh painted part to a layer, returning its index.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user