Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Text Frame Options: the paragraph spacing limit set without another branch in text_frame_options

moppeeer963ac447faaf
diff --git a/crates/engine/src/cmd/object.rs b/crates/engine/src/cmd/object.rs
index c5c3ce307..474d22ca8 100644
--- a/crates/engine/src/cmd/object.rs
+++ b/crates/engine/src/cmd/object.rs
@@ -2592,9 +2592,7 @@ fn text_frame_options(s: &mut Session, p: &Value) -> Result<Value> {
if let Some(v) = reference {
o.auto_size_ref = v;
}
- if let Some(v) = spacing_limit {
- o.vj_paragraph_spacing_limit = v;
- }
+ o.vj_paragraph_spacing_limit = spacing_limit.unwrap_or(o.vj_paragraph_spacing_limit);
if let Some(v) = p.get("useMinimumHeight").and_then(Value::as_bool) {
o.auto_size_use_min_height = v;
}