mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-15 08:45:25 +00:00
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:
@@ -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)) };
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user