From 928ea98e1aae6e3806699692899b5306772d294b Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 8 Nov 2020 22:45:32 +0000 Subject: [PATCH] wip new arrangements, otter cli Signed-off-by: Ian Jackson --- src/bin/otter.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/bin/otter.rs b/src/bin/otter.rs index b51ffac9..b7118ae6 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -751,7 +751,12 @@ mod library_add { Poor(insns, "surplus marker(s) removed") } else { - let good : ArrayVec<_> = markers.iter().map(|p| p.pos).collect(); + let mut good : ArrayVec<_> = default(); + for p in &markers { + good.push(p.visible.as_ref().ok_or_else( + || anyhow!("library marker(s) with hidden position!") + )?.pos); + } Good(good.into_inner().unwrap()) }; if ma.verbose > 2 { dbg!(&situation); } @@ -808,8 +813,8 @@ mod library_add { if let Some((nclhs, clash_bot)) = pieces.iter() .filter_map(|p| { - let tl = p.pos + p.bbox[0]; - let br = p.pos + p.bbox[1]; + let tl = p.visible?.pos + p.visible?.bbox[0]; + let br = p.visible?.pos + p.visible?.bbox[1]; if tl.0[0] >= self.clhs || tl.0[1] >= ncbot || -- 2.30.2