This commit is contained in:
Simon Gardling
2022-02-14 09:58:43 -05:00
parent 918bae6bec
commit 544989e4b2
2 changed files with 6 additions and 6 deletions

View File

@@ -44,13 +44,13 @@ impl Chart {
.map_err(|err| err.to_string())?;
let map_coord = draw_output.0;
return Ok(Chart {
convert: Box::new(move |coord| map_coord(coord).map(|(x, y)| (x.into(), y.into()))),
Ok(Chart {
convert: Box::new(move |coord| map_coord(coord).map(|(x, y)| (x, y))),
area: draw_output.1,
});
})
}
pub fn get_area(&self) -> f32 { return self.area; }
pub fn get_area(&self) -> f32 { self.area }
pub fn coord(&self, x: i32, y: i32) -> Option<Point> {
(self.convert)((x, y)).map(|(x, y)| Point::new(x, y))