diff --git a/crates/ui-canvas/src/canvas/crop/gesture.rs b/crates/ui-canvas/src/canvas/crop/gesture.rs index 17fc6511e..b0c322a19 100644 --- a/crates/ui-canvas/src/canvas/crop/gesture.rs +++ b/crates/ui-canvas/src/canvas/crop/gesture.rs @@ -175,7 +175,7 @@ impl Rules { if corner && !lines.is_empty() && self.hold(mods) != AspectHold::Free { // The reach at the press view: the rule `Snap::at` sets the tolerance with; a crop drag never // changes the zoom. - let Some(reach) = snap_tolerance(drag.press_view.as_ref().unwrap_or(view), mods, self.os, false) else { + let Some(reach) = snap_tolerance(drag.press_view.as_ref().unwrap_or(view), mods, self.os, snap.options().suspend, false) else { return (to, Vec::new()); }; match slid_along(point, point - candidate.center(), lines, reach) { diff --git a/crates/ui-canvas/src/canvas/crop/mod.rs b/crates/ui-canvas/src/canvas/crop/mod.rs index f2a9256ac..db4abd753 100644 --- a/crates/ui-canvas/src/canvas/crop/mod.rs +++ b/crates/ui-canvas/src/canvas/crop/mod.rs @@ -171,9 +171,26 @@ pub struct CropOverlay<'a> { /// Nothing is painted and a press anywhere on the canvas draws a new frame. #[prop(flag)] hidden: bool, + /// What the crop is bounded by: the document, or one placed picture's source. + #[prop] + scope: CropScope, report: Report, } +/// What a crop is of. +#[derive(Clone, Copy, Debug, Default, PartialEq)] +#[non_exhaustive] +pub enum CropScope { + /// The document. + #[default] + Document, + /// One placed picture, bounded by its source. + Object { + /// The picture's source rectangle, in document units; it bounds the drag rules. + source: DocRect, + }, +} + impl<'a> CropOverlay<'a> { /// An overlay named `label` over `crop`. A mixed value shows the whole document. pub fn new(label: impl Into