diff --git a/plate-tool-lib/src/transfer_region.rs b/plate-tool-lib/src/transfer_region.rs index 26dbc3f..a2227a2 100644 --- a/plate-tool-lib/src/transfer_region.rs +++ b/plate-tool-lib/src/transfer_region.rs @@ -131,10 +131,8 @@ impl TransferRegion { pub fn calculate_map(&self) -> Box Option> + '_> { // By validating first, we have a stronger guarantee that // this function will not panic. :) - // log::debug!("Validating: {:?}", self.validate()); if let Err(msg) = self.validate() { - eprintln!("{}", msg); - eprintln!("This transfer will be empty."); + log::error!("{}\nThis transfer will be empty.", msg); return Box::new(|_| None); } @@ -308,11 +306,15 @@ impl TransferRegion { // log::debug!("s1.1: {}, max.1: {}", s1.1, source_max.1); return Err("Source region is out-of-bounds! (Too wide)"); } + + if il_dest == (0,0) { + return Err("Refusing to pool both dimensions in a rectangular transfer!\nPlease select a point in the destination plate.") + } } Region::Custom(_) => return Ok(()), } - if il_source.0 == 0 || il_dest.1 == 0 { + if il_source.0 == 0 || il_source.1 == 0 { return Err("Source interleave cannot be zero!"); }