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.
This commit is contained in:
dotCooCoo
2026-11-14 05:09:42 -08:00
parent a47d7eec91
commit 765a98e49e
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -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)) };
+4 -1
View File
@@ -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()