diff --git a/crates/compose/src/lib.rs b/crates/compose/src/lib.rs index 4efd32bf5..14a97be2b 100644 --- a/crates/compose/src/lib.rs +++ b/crates/compose/src/lib.rs @@ -417,7 +417,7 @@ pub fn frame_specs(doc: &Document, sid: StoryId) -> Vec { path: None, ..tf.options.clone() }; - let end = pt.end.map_or(len, |e| e.clamp(0.0, len)); + let end = pt.end.map_or(len, |e| e.max(0.0).min(len)); (Rect::new(0.0, 0.0, (end - pt.start).max(1.0), size * 1.6), opts) } None => (item.text_area(), tf.options.clone()), diff --git a/crates/engine/src/cmd/path_type.rs b/crates/engine/src/cmd/path_type.rs index 9ce091a7e..02e5a1901 100644 --- a/crates/engine/src/cmd/path_type.rs +++ b/crates/engine/src/cmd/path_type.rs @@ -97,7 +97,7 @@ fn path_options(s: &mut Session, p: &Value) -> Result { return Ok(json!({"deleted": true})); } if let Some(v) = p.get("start").and_then(Value::as_f64).filter(|v| v.is_finite()) { - pt.start = v.clamp(0.0, len); + pt.start = v.max(0.0).min(len); } match p.get("end") { Some(Value::Null) => pt.end = None,