Document Info: a Repeat Objects category lists the document's repeats

Document Info had no Repeat Objects category, and document.info
refused category "repeats". The reference app's Document Info panel
menu lists Repeat Objects after Font Details.

Document Info now has a Repeat Objects category after Embedded Images.
It lists each radial, grid and mirror Repeat object by name with its
kind and the number of instances it makes. For a grid it gives the
rows and columns instead, followed by the number of instances it
draws when that is fewer. The count comes from the new
RepeatSpec::instances, which gives the number of instances a repeat
draws. That number is smaller than its options give when repeats
nested in its source would pass the instance budget. With Selection
Only the category lists the Repeat objects in the selection.
document.info gives them as repeatObjects, the panel's flyout offers
the category, and the text report that Document Info › Save… and
File › Package write has a REPEAT OBJECTS section. The title has a row
in every catalog.

Docs: docs/mcp.md, docs/target-app-parity.md.
This commit is contained in:
dotCooCoo
2026-10-22 00:01:36 +07:00
committed by bflatastic
parent 4f5f573ded
commit 4d1581f3da
29 changed files with 173 additions and 13 deletions
+5
View File
@@ -572,6 +572,11 @@ impl RepeatSpec {
fn kept(&self, nested: usize) -> usize {
self.kind.count().min(MAX_REPEAT_INSTANCES / nested.max(1)).max(1)
}
/// How many instances this Repeat draws ([`Self::transforms`]): as many as its options make,
/// fewer when the Repeats in its source would take it past [`MAX_REPEAT_INSTANCES`].
pub fn instances(&self) -> usize {
self.kept(nested_instances(&self.source))
}
/// Instances made in all, those of the Repeats nested in the source included.
fn instances_in_all(&self) -> usize {
let nested = nested_instances(&self.source);