Skip to content

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

Merge PR #7838: Free Transform: a result may take what Memory Usage allows, not 2^30 px (#7807)

aiongg66e54580b70f
diff --cc crates/engine/src/select_extra_cmds.rs
index 751f710ac,85df00dba..b3fae926e
--- a/crates/engine/src/select_extra_cmds.rs
+++ b/crates/engine/src/select_extra_cmds.rs
@@@ -156,9 -145,11 +156,11 @@@ fn affine_params(cmd: &str, p: &Value,
let rot = Homography([ca, -sa, 0.0, sa, ca, 0.0, 0.0, 0.0, 1.0]);
let skew = Homography([1.0, kx, 0.0, ky, 1.0, 0.0, 0.0, 0.0, 1.0]);
let scale = Homography([sx, 0.0, 0.0, 0.0, sy, 0.0, 0.0, 0.0, 1.0]);
- t(px + dx, py + dy).mul(&rot).mul(&skew).mul(&scale).mul(&t(-px, -py))
+ Ok(t(px + dx, py + dy).mul(&rot).mul(&skew).mul(&scale).mul(&t(-px, -py)))
}
+ /// Select › Transform Selection: warps the selection outline by the params' matrix, quad or
+ /// scale/rotate/move, refused when the result would not fit the transform budget.
fn transform_selection(s: &mut Session, p: &Value) -> Result<Value> {
const CMD: &str = "select.transformSelection";
let d = s.active().ok_or(EngineError::NoDocument)?;