Skip to content

Commit

Permalink
✨ Add convenience Region.rectangle to make a Object::Rectangle from a…
Browse files Browse the repository at this point in the history
… Region
  • Loading branch information
ewen-lbh committed Sep 19, 2024
1 parent 7dd488d commit 2488019
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/region.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::Point;
use crate::{Object, Point};
use anyhow::{format_err, Error, Result};
use backtrace::Backtrace;
use rand::Rng;
Expand Down Expand Up @@ -46,6 +46,10 @@ impl Region {

Ok(())
}

pub fn rectangle(&self) -> Object {
Object::Rectangle(self.start, self.end)
}
}

pub struct RegionIterator {
Expand Down

0 comments on commit 2488019

Please sign in to comment.