From 818de14222cf6eef1f0bd7efc480eaa8de80b044 Mon Sep 17 00:00:00 2001 From: Brian Torres Date: Mon, 19 Oct 2026 12:10:08 -0700 Subject: [PATCH] Free Transform: document the budget check and its refusal test (#7807) Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/transform_cmds.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/engine/src/transform_cmds.rs b/crates/engine/src/transform_cmds.rs index 6526c3adc06..d8586e8bc99 100644 --- a/crates/engine/src/transform_cmds.rs +++ b/crates/engine/src/transform_cmds.rs @@ -277,6 +277,7 @@ pub(crate) fn check_budget(src: Rect, h: &Homography, what: &str) -> Result<()> check_budget_with_limit(src, h, what, BUDGET) } +/// [`check_budget`] against `budget` px (the tests price the production limit with it). fn check_budget_with_limit(src: Rect, h: &Homography, what: &str, budget: u64) -> Result<()> { let Some((w, ht)) = warp_output_size(src, h) else { return Ok(()) }; if w.saturating_mul(ht) > budget { @@ -779,6 +780,8 @@ mod tests { json!({"matrix": [k, 0, 0, 1, -10.0 * k, 0], "interpolation": "nearest"}) } + /// A stretch past the budget is refused with the limit named, and the document, its revision + /// and History stay as they were; within the budget the same stretch applies unclipped. #[test] fn a_scale_past_the_pixel_budget_is_refused_and_changes_nothing() { let mut s = column();