diff --git a/src/layout.rs b/src/layout.rs index e724d5b..5bc0041 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -374,6 +374,12 @@ pub struct Rect { impl Rect { /// Creates a new rect, with width and height limited to keep the area under max u16. /// If clipped, aspect ratio will be preserved. + /// + /// The X Axis represents the count of columns of the Rect. + /// + /// The Y Axis represents the count of rows of the Rect. + /// + /// The Rect is always drawn from the top left to the bottom and to the right of the container. pub fn new(x: u16, y: u16, width: u16, height: u16) -> Rect { let max_area = u16::max_value(); let (clipped_width, clipped_height) = diff --git a/src/widgets/canvas/line.rs b/src/widgets/canvas/line.rs index 3a3d920..d2710b4 100644 --- a/src/widgets/canvas/line.rs +++ b/src/widgets/canvas/line.rs @@ -4,6 +4,14 @@ use crate::{ }; /// Shape to draw a line from (x1, y1) to (x2, y2) with the given color +/// +/// The X Axis represents the count of columns of the Line. +/// +/// The Y Axis represents the count of rows of the Line. +/// +/// The Line is always drawn from the top left to the bottom and to the right of the container. +/// +/// And when it is drawn, it will calculate the distance between the two points #[derive(Debug, Clone)] pub struct Line { pub x1: f64, diff --git a/src/widgets/canvas/points.rs b/src/widgets/canvas/points.rs index 83aeaba..587b72b 100644 --- a/src/widgets/canvas/points.rs +++ b/src/widgets/canvas/points.rs @@ -4,6 +4,12 @@ use crate::{ }; /// A shape to draw a group of points with the given color +/// +/// The X Axis represents the count of columns of the container. +/// +/// The Y Axis represents the count of rows of the container. +/// +/// The first value of the coordinate is the X axis, the second value is the Y axis. #[derive(Debug, Clone)] pub struct Points<'a> { pub coords: &'a [(f64, f64)], diff --git a/src/widgets/canvas/rectangle.rs b/src/widgets/canvas/rectangle.rs index 2a211e7..b918561 100644 --- a/src/widgets/canvas/rectangle.rs +++ b/src/widgets/canvas/rectangle.rs @@ -4,6 +4,12 @@ use crate::{ }; /// Shape to draw a rectangle from a `Rect` with the given color +/// +/// The X Axis represents the count of columns of the Rectangle. +/// +/// The Y Axis represents the count of rows of the Rectangle. +/// +/// The Rectangle is always drawn from the top left to the bottom and to the right of the container. #[derive(Debug, Clone)] pub struct Rectangle { pub x: f64,