From 765a98e49e6bf3b93b45e50f3813894a1960db46 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 14 Nov 2026 05:09:42 -0800 Subject: [PATCH] PDF/.ai export: give the present reason area type with wrap shapes is written as outlines The text document of the editing data does not hold an area text object's wrap shapes. On reopening, the reader works them out again from the art above the type, which can wrap it differently (a live object written as its drawn pieces) or not at all. The comments on the check in holds and in a thread's frame check now say so, and the outlines test's comment no longer says the wrap object's settings are not written. --- crates/eps/src/ai_editing/tests.rs | 4 ++-- crates/eps/src/ai_editing/writer/texts.rs | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/eps/src/ai_editing/tests.rs b/crates/eps/src/ai_editing/tests.rs index a3b2800fd3..0fba16781c 100644 --- a/crates/eps/src/ai_editing/tests.rs +++ b/crates/eps/src/ai_editing/tests.rs @@ -4473,8 +4473,8 @@ fn type_the_data_cant_hold_is_written_as_its_outlines() { rings.subpaths.extend(shapes::rectangle(Rect::new(120.0, 30.0, 170.0, 70.0)).subpaths); holed.kind = vectorcraft_doc::TextKind::Area { frame: rings }; holed.xf = Affine::IDENTITY; - // A carriage return in the characters: a story ends its paragraphs with it. Area type that - // flows around a wrap object: the wrap object's settings aren't written. + // A carriage return in the characters: a story ends its paragraphs with it. Area type with + // wrap shapes and no wrap object: the text document doesn't hold the shapes. let returned = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::new(10.0, 90.0), "A\rB", style(10.0, Color::BLACK)); let mut wrapped = vectorcraft_doc::TextObject::point(vectorcraft_geom::Point::ZERO, "Wrapped round", style(10.0, Color::BLACK)); wrapped.kind = vectorcraft_doc::TextKind::Area { frame: shapes::rectangle(Rect::new(10.0, 10.0, 90.0, 60.0)) }; diff --git a/crates/eps/src/ai_editing/writer/texts.rs b/crates/eps/src/ai_editing/writer/texts.rs index 6bc3c63b09..885af725b7 100644 --- a/crates/eps/src/ai_editing/writer/texts.rs +++ b/crates/eps/src/ai_editing/writer/texts.rs @@ -204,7 +204,9 @@ pub(in crate::ai_editing) fn holds(n: &Node, t: &TextObject) -> bool { shape(t).as_ref().and_then(segments).is_some_and(|s| !(open && closed(&s))) } }; - // Area type that flows around wrap objects: the data doesn't hold their wrap settings. + // Area type with wrap shapes: the text document doesn't hold them. The reader works them out + // again from the art above the type, which can wrap it differently (a live object written as + // its drawn pieces) or not at all. shape_ok && t.wrap.is_empty() && t.ruby.is_empty() @@ -962,6 +964,7 @@ impl TextDoc { matches!(t.kind, TextKind::Area { .. }) && t.vertical == vertical && writable(n.id) + // The text document doesn't hold wrap shapes (see `holds`). && t.wrap.is_empty() && plain(n) && t.ruby.is_empty()