Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Integration: #7574 the lift outline allocates fallibly

aiongg8d0f920ea6b5
diff --git a/crates/engine/src/float_cmds.rs b/crates/engine/src/float_cmds.rs
index 72b698f55..12b06bd76 100644
--- a/crates/engine/src/float_cmds.rs
+++ b/crates/engine/src/float_cmds.rs
@@ -77,9 +77,9 @@ impl CutParts {
// marching ants hug the piece as the drag starts, #7538). A mask has no outline.
if !mask {
let n = with_alpha.channels();
- let cover: Vec<f32> = piece.read_region(b).chunks_exact(n).filter_map(|p| p.last().copied()).collect();
+ let cover: Vec<f32> = piece.try_read_region(b)?.chunks_exact(n).filter_map(|p| p.last().copied()).collect();
let mut o = Surface::new(PixelFormat::new(ColorMode::Grayscale, sel.format().sample, false));
- o.write_region(b, &cover);
+ o.try_write_region(b, &cover)?;
o.prune();
outline = Some(o);
}