docs: add some lines of documentation to clear doubts

pull/677/head
Phosphorus 2 years ago
parent fafad6c961
commit 05e5d2a301

@ -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) =

@ -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,

@ -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)],

@ -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,

Loading…
Cancel
Save