aboutsummaryrefslogtreecommitdiff
path: root/src/math/rect.rs
diff options
context:
space:
mode:
authorArne Dußin2021-01-06 22:56:37 +0100
committerArne Dußin2021-01-06 22:56:37 +0100
commitfa1afb6be3ba2d521eb0791edc0bb8e631a85327 (patch)
treee0a365444784efaaeb1eea6373b34559b6d57fbc /src/math/rect.rs
parent1c81d7c70fe891e6ded49d49d6a09f04ce74dd6e (diff)
parent30b23db9e86fdf72a4e7de72213df274ce19123e (diff)
downloadgraf_karto-fa1afb6be3ba2d521eb0791edc0bb8e631a85327.tar.gz
graf_karto-fa1afb6be3ba2d521eb0791edc0bb8e631a85327.zip
Merge branch 'master' into snapping
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