diff --git a/crates/ui-canvas/src/canvas/crop/mod.rs b/crates/ui-canvas/src/canvas/crop/mod.rs index f2a9256ac..01e6f80aa 100644 --- a/crates/ui-canvas/src/canvas/crop/mod.rs +++ b/crates/ui-canvas/src/canvas/crop/mod.rs @@ -171,9 +171,33 @@ pub struct CropOverlay<'a> { /// Nothing is painted and a press anywhere on the canvas draws a new frame. #[prop(flag)] hidden: bool, + /// What a press outside the frame does: turns it, applies the crop, or draws a new frame. + #[prop] + #[allow(dead_code)] // P3(pdf-edit-w4): ED-F8 + outside: CropOutside, + /// The quad the frame is bounded to, drawn as an outline in the guide colour. + #[prop] + #[allow(dead_code)] // P3(pdf-edit-w4): ED-F8 + area: Option<[Point; 4]>, + /// The smallest side a drawn frame keeps. + #[prop(quantity = "document units")] + min_side: f64, report: Report, } +/// What a press outside a crop frame does. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +#[non_exhaustive] +pub enum CropOutside { + /// The press turns the frame. + #[default] + Turn, + /// The press applies the crop. + Apply, + /// The press draws a new frame. + NewFrame, +} + impl<'a> CropOverlay<'a> { /// An overlay named `label` over `crop`. A mixed value shows the whole document. pub fn new(label: impl Into