Merge pull request #7593 from dotCooCoo/fix/ai-writer-wrap-comment

PDF/.ai export: the comment gives the present reason area type with wrap shapes is written as outlines
This commit is contained in:
BFlat
2026-11-15 00:42:14 +07:00
committed by GitHub
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -4495,8 +4495,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()