OLE2FRAME: arrays refuse before adding copies; clearer refusal (review on #2587)

ARRAYPATH with align and polar arrays that rotate items refused part way, leaving the earlier copies in the drawing. Every copy's matrix is now checked before the first copy is made. The refusal text names the other unsupported transforms. Test: arraypath_refuses_before_adding_any_copy.
This commit is contained in:
SBaksa
2026-11-03 16:37:51 +11:00
parent 0a0a820759
commit be413af026
4 changed files with 36 additions and 5 deletions
+8 -2
View File
@@ -247,9 +247,15 @@ fn max_count(s: &Session, others: u64, objs: usize) -> u64 {
}
fn copy_all(s: &mut Session, hs: &[Handle], mats: impl Iterator<Item = Mat3>) -> Result<usize> {
// Every copy is checked before the first is made: a refusal part way would leave the copies
// already added in the drawing (a failed command is not rolled back).
let mats: Vec<Mat3> = mats.collect();
for m in &mats {
super::modify::refuse_ole_frames(s, hs, m, true)?;
}
let mut n = 0;
for m in mats {
n += transform_entities(s, hs, &m, true)?.len();
for m in &mats {
n += transform_entities(s, hs, m, true)?.len();
}
Ok(n)
}