From eecac7b5d163794645bcce8e450c74e3eb5e999f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sat, 31 Aug 2019 04:31:13 +0200 Subject: Remove `nalgebra` dependency - Implement our own `Point` and `Vector` types - Make `Rectangle` not generic --- src/rectangle.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/rectangle.rs') diff --git a/src/rectangle.rs b/src/rectangle.rs index ca224dad..9f2a1350 100644 --- a/src/rectangle.rs +++ b/src/rectangle.rs @@ -1,25 +1,25 @@ use crate::Point; -/// A generic rectangle. -#[derive(Debug, PartialEq, Eq, Copy, Clone)] -pub struct Rectangle { +/// A rectangle. +#[derive(Debug, PartialEq, Copy, Clone)] +pub struct Rectangle { /// X coordinate of the top-left corner. - pub x: T, + pub x: f32, /// Y coordinate of the top-left corner. - pub y: T, + pub y: f32, /// Width of the rectangle. - pub width: T, + pub width: f32, /// Height of the rectangle. - pub height: T, + pub height: f32, } -impl Rectangle { +impl Rectangle { /// Returns true if the given [`Point`] is contained in the [`Rectangle`]. /// - /// [`Point`]: type.Point.html + /// [`Point`]: struct.Point.html /// [`Rectangle`]: struct.Rectangle.html pub fn contains(&self, point: Point) -> bool { self.x <= point.x -- cgit