diff --git a/plotters/src/element/basic_shapes.rs b/plotters/src/element/basic_shapes.rs index 3c2564ec..c43af473 100644 --- a/plotters/src/element/basic_shapes.rs +++ b/plotters/src/element/basic_shapes.rs @@ -418,6 +418,20 @@ impl Rectangle { self.margin = (t, b, l, r); self } + + /// Get the points of the rectangle + /// - returns the element points + pub fn get_points(&self) -> (&Coord, &Coord) { + (&self.points[0], &self.points[1]) + } + + /// Set the style of the rectangle + /// - `style`: The shape style + /// - returns a mut reference to the rectangle + pub fn set_style>(&mut self, style: S) -> &mut Self { + self.style = style.into(); + self + } } impl<'a, Coord> PointCollection<'a, Coord> for &'a Rectangle {