pub fn or_crop_to_1x1_if_empty(self) -> Cropped where Original: Crop<Cropped=Cropped> + GetBounds {
        match self {
            CropResult::Cropped (cropped) => cropped,
            CropResult::Empty { original } => {
                let bounds = original.bounds();
                if bounds.size == Vec2(0,0) { panic!("layer has width and height of zero") }
                original.crop(IntegerBounds::new(bounds.position, Vec2(1,1)))
            },
        }
    }
/// If the image was fully empty, crop to one single pixel of all the transparent pixels instead,
/// leaving the layer intact while reducing memory usage.
If the image was fully empty, crop to one single pixel of all the transparent pixels instead,
leaving the layer intact while reducing memory usage.
If the image was fully empty crop to one single pixel of all the transparent pixels instead leaving the layer intact while reducing memory usage .
pub fn or_crop_to_1x1_if_empty(self) -> Cropped where Original: Crop<Cropped=Cropped> + GetBounds {
        match self {
            CropResult::Cropped (cropped) => cropped,
            CropResult::Empty { original } => {
                let bounds = original.bounds();
                if bounds.size == Vec2(0,0) { panic!("layer has width and height of zero") }
                original.crop(IntegerBounds::new(bounds.position, Vec2(1,1)))
            },
        }
    }
pub fn or_crop_to_1x1_if_empty ( self ) -> Cropped where Original : Crop < Cropped = Cropped > + GetBounds { match self { CropResult :: Cropped ( cropped ) => cropped , CropResult :: Empty { original } => { let bounds = original . bounds ( ) ; if bounds . size == Vec2 ( 0 , 0 ) { panic ! ( " " ) } original . crop ( IntegerBounds :: new ( bounds . position , Vec2 ( 1 , 1 ) ) ) } , } }
If the image was fully empty, crop to one single pixel of all the transparent pixels instead,
leaving the layer intact while reducing memory usage.
If the image was fully empty crop to one single pixel of all the transparent pixels instead leaving the layer intact while reducing memory usage .
self
self