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:
+40
-6
@@ -96,6 +96,8 @@ export struct PartRow {
|
||||
/// The selection the layer began as. It joins nothing and cannot be
|
||||
/// removed — removing it is removing the layer.
|
||||
base: bool,
|
||||
/// Left out of the build, and kept. The row's eye.
|
||||
hidden: bool,
|
||||
}
|
||||
|
||||
/// Which part of a gradient a canvas handle drags.
|
||||
@@ -174,6 +176,7 @@ component MaskEntry inherits Rectangle {
|
||||
/// Point the tools at one part, change how it joins, or take it out.
|
||||
callback part-selected(int);
|
||||
callback part-join-picked(int, int);
|
||||
callback part-hidden-toggled(int, bool);
|
||||
callback part-removed(int);
|
||||
/// Join a fresh painted correction: 0 adds, 1 subtracts.
|
||||
callback part-added(int);
|
||||
@@ -210,6 +213,7 @@ component MaskEntry inherits Rectangle {
|
||||
// where: Develop
|
||||
// touch: Tap the ring at the head of its row
|
||||
// pointer: Click the ring at the head of its row
|
||||
// keys: H, for the selected layer
|
||||
// why: Disabling a layer is the before-and-after a local
|
||||
// edit constantly wants, so it is one press away rather
|
||||
// than inside the row. It is an edit and does take a
|
||||
@@ -387,6 +391,33 @@ component MaskEntry inherits Rectangle {
|
||||
horizontal-stretch: 1;
|
||||
}
|
||||
|
||||
// GESTURE: Leave one part out of a mask, and put it back
|
||||
// where: Develop
|
||||
// touch: Tap the ring on the part's row
|
||||
// pointer: Click the ring on the part's row
|
||||
// why: The question a correction raises is whether
|
||||
// it did what it was for — whether the stroke
|
||||
// filled the shoulder, whether the subtracted
|
||||
// gradient took only the sky. Removing it
|
||||
// answers that and loses it. The same ring the
|
||||
// layer wears, one row down, because it is the
|
||||
// same question about a smaller thing.
|
||||
//
|
||||
// TRACES: FR-DEV-19a
|
||||
part-eye := TouchArea {
|
||||
width: Theme.touch-target;
|
||||
mouse-cursor: pointer;
|
||||
enabled: root.enabled;
|
||||
clicked => { root.part-hidden-toggled(i, !part.hidden); }
|
||||
|
||||
Label {
|
||||
text: part.hidden ? "○" : "◉";
|
||||
emphasised: part-eye.has-hover || !part.hidden;
|
||||
horizontal-alignment: center;
|
||||
vertical-alignment: center;
|
||||
}
|
||||
}
|
||||
|
||||
if !part.base: cut := TouchArea {
|
||||
width: Theme.touch-target;
|
||||
mouse-cursor: pointer;
|
||||
@@ -790,6 +821,12 @@ export global Masking {
|
||||
callback mask-removed(string);
|
||||
callback mask-refined(string);
|
||||
callback mask-toggled(string, bool);
|
||||
/// TRACES: FR-DEV-16
|
||||
/// The same switch for whichever layers are selected, from the keyboard.
|
||||
/// No id, because the selection is the session's and this file cannot
|
||||
/// see it; Rust answers by flipping each selected layer through the same
|
||||
/// path the ring takes, so it is one history step per layer either way.
|
||||
callback selected-toggled();
|
||||
callback mask-invert-toggled(string, bool);
|
||||
callback mask-opacity-changed(string, float);
|
||||
callback mask-feather-changed(string, float);
|
||||
@@ -810,6 +847,8 @@ export global Masking {
|
||||
/// TRACES: FR-DEV-19a
|
||||
callback part-selected(string, int);
|
||||
callback part-join-picked(string, int, int);
|
||||
/// Whether the part at this index is left out of the build.
|
||||
callback part-hidden-toggled(string, int, bool);
|
||||
callback part-removed(string, int);
|
||||
callback part-added(string, int);
|
||||
|
||||
@@ -820,12 +859,6 @@ export global Masking {
|
||||
callback add-range(bool);
|
||||
callback add-subject(int);
|
||||
callback add-category(string);
|
||||
/// TRACES: FR-DEV-16
|
||||
/// The same switch for whichever layers are selected, from the keyboard.
|
||||
/// No id, because the selection is the session's and this file cannot
|
||||
/// see it; Rust answers by flipping each selected layer through the same
|
||||
/// path the ring takes, so it is one history step per layer either way.
|
||||
callback selected-toggled();
|
||||
}
|
||||
|
||||
export component MaskPanel inherits Rectangle {
|
||||
@@ -1155,6 +1188,7 @@ export component MaskPanel inherits Rectangle {
|
||||
parts: mask.selected ? Masking.parts : [];
|
||||
part-selected(i) => { Masking.part-selected(mask.id, i); }
|
||||
part-join-picked(i, j) => { Masking.part-join-picked(mask.id, i, j); }
|
||||
part-hidden-toggled(i, on) => { Masking.part-hidden-toggled(mask.id, i, on); }
|
||||
part-removed(i) => { Masking.part-removed(mask.id, i); }
|
||||
part-added(j) => { Masking.part-added(mask.id, j); }
|
||||
shown-toggled(on) => { Masking.mask-shown-toggled(mask.id, on); }
|
||||
|
||||
Reference in New Issue
Block a user