From 3c114da73e4da362ea1c19edead7152bc8728936 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 3 Apr 2021 03:48:42 +0100 Subject: [PATCH] organise: Adjust overlaps, introduce AbutCompr Signed-off-by: Ian Jackson --- src/organise.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/organise.rs b/src/organise.rs index 276e9edf..12ad5212 100644 --- a/src/organise.rs +++ b/src/organise.rs @@ -37,6 +37,7 @@ enum Attempt { Nonoverlap, Inside, Abut, + AbutCompr, Hanging, } use Attempt as A; @@ -48,7 +49,8 @@ impl Attempt { match self { A::Nonoverlap | A::Inside => (cnr - PosC::both(MARGIN_INSIDE))?, - A::Abut => cnr, + A::Abut | + A::AbutCompr => cnr, A::Hanging => PosC::both(-HANG_INSIDE), } } @@ -59,7 +61,8 @@ impl Attempt { match self { A::Nonoverlap | A::Inside => (cnr + PosC::both(MARGIN_INSIDE))?, - A::Abut => cnr, + A::Abut | + A::AbutCompr => cnr, A::Hanging => PosC::both(HANG_INSIDE), } } @@ -70,8 +73,9 @@ impl Attempt { match self { A::Nonoverlap => (cnr + PosC::both(MARGIN_INSIDE))?, A::Inside | - A::Abut => (bbox.tl() - bbox.tl().map(|v| v/3))?, - A::Hanging => PosC::both(HANG_INSIDE), + A::Abut => (bbox.tl() - bbox.tl().map(|v| v/ 2 ))?, + A::AbutCompr => (bbox.tl() - bbox.tl().map(|v| v/ 3 ))?, + A::Hanging => PosC::both(HANG_INSIDE), } } } -- 2.30.2