From af8fcdde8854985287c7b9580a77543275bbd70c Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 14 Feb 2022 11:24:52 -0500 Subject: [PATCH] add checks --- src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 0f54f54..85504d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -173,6 +173,18 @@ impl ChartManager { | (min_y != self.min_y) | (max_y != self.max_y); + if min_x >= max_x { + panic!("min_x is greater than (or equal to) than max_x!"); + } + + if min_y >= max_y { + panic!("min_y is greater than (or equal to) than max_y!"); + } + + if 0 > resolution { + panic!("resolution cannot be less than 0"); + } + self.use_back_cache = !underlying_update && self.resolution == resolution && self.back_cache.is_some(); self.use_front_cache = match underlying_update {