aboutsummaryrefslogtreecommitdiff
path: root/src/math/rect.rs
diff options
context:
space:
mode:
authorArne Dußin2021-01-06 22:44:08 +0100
committerGitHub2021-01-06 22:44:08 +0100
commit30b23db9e86fdf72a4e7de72213df274ce19123e (patch)
treeb06b5bf6a21e64ff1bfafff90861532e651352d5 /src/math/rect.rs
parent0eada0bdcb36a9907c6c928aa707ed6bef03c02f (diff)
parent53d376eaeef991850d35318b147f75c8f103319d (diff)
downloadgraf_karto-30b23db9e86fdf72a4e7de72213df274ce19123e.tar.gz
graf_karto-30b23db9e86fdf72a4e7de72213df274ce19123e.zip
Merge pull request #25 from LordSentox/better-polygons
Change to polygongraph instead of polygon in roomtool
Diffstat (limited to 'src/math/rect.rs')
-rw-r--r--src/math/rect.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/math/rect.rs b/src/math/rect.rs
index 6f993d1..b019ad5 100644
--- a/src/math/rect.rs
+++ b/src/math/rect.rs
@@ -1,9 +1,8 @@
//! Rectangles where the sides are parallel to the x and y-axes.
-use super::{LineSegment, Polygon, Surface, Vec2};
+use super::{ExactSurface, LineSegment, Polygon, Vec2};
//use alga::general::{Additive, Identity};
-use nalgebra::{ClosedAdd, ClosedSub, RealField, Scalar};
-use num_traits::identities::Zero;
+use nalgebra::{RealField, Scalar};
use num_traits::{NumCast, ToPrimitive};
use serde::{Deserialize, Serialize};
use std::ops::{Add, AddAssign};
@@ -150,7 +149,7 @@ impl<T: Scalar + Copy> Rect<T> {
}
}
-impl<T: Scalar + Copy + PartialOrd + ClosedAdd + ClosedSub + Zero> Surface<T> for Rect<T> {
+impl<T: RealField> ExactSurface<T> for Rect<T> {
fn contains_point(&self, point: &Vec2<T>) -> bool {
point.x >= self.x
&& point.x <= self.x + self.w