Say so when a crop leaves a mask outside the frame
Cropping tighter past a mask layer made it invisible without a word: the layer stayed in the panel and the sidecar, and its adjustment went on landing on pixels nobody would see again. When a crop is let go, develop now measures what the gesture did to the mask stack (dr_pipeline::orphan) and, if any layer is now entirely or mostly outside the frame, shows a notice over the photograph: how many layers, their names, "Undo crop" and "Keep crop". The crop is already applied and nothing waits on the answer. The crop overlay gains a release callback carrying the rect the press began from, so the measurement runs once per gesture and never on the drag's per-frame changes. Choosing a ratio is measured the same way, being a crop committed in one click. "Undo crop" is the ordinary undo, and the notice is tied to the history revision it was raised at: the redraw that follows any history move clears it, so the crop and its warning go back as one step. A second drag folded into the same step is measured from where that step began. A crop that strands nothing shows nothing.
This commit is contained in:
@@ -107,6 +107,10 @@ pub struct DevelopSession {
|
||||
/// comparison is held. Viewing state: nothing about the edit changes,
|
||||
/// and it goes down with the session.
|
||||
pub(super) compared_snapshot: Option<String>,
|
||||
/// TRACES: FR-DEV-17
|
||||
/// The layers the last committed crop took out of the frame, while the
|
||||
/// history still stands on that crop. See [`super::framing::CropNotice`].
|
||||
pub(super) crop_notice: Option<super::framing::CropNotice>,
|
||||
pub(super) demosaiced: Arc<DemosaicedImage>,
|
||||
pub(super) adjust: AdjustPass,
|
||||
/// TRACES: FR-DSP-7
|
||||
@@ -373,6 +377,7 @@ impl DevelopSession {
|
||||
snapshots: Vec::new(),
|
||||
removed_snapshots: Vec::new(),
|
||||
compared_snapshot: None,
|
||||
crop_notice: None,
|
||||
demosaiced: Arc::new(demosaiced),
|
||||
adjust: AdjustPass::new(ctx),
|
||||
histogram: HistogramPass::new(ctx)
|
||||
|
||||
Reference in New Issue
Block a user