aboutsummaryrefslogtreecommitdiff
path: root/src/math/line_segment.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/line_segment.rs')
-rw-r--r--src/math/line_segment.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/math/line_segment.rs b/src/math/line_segment.rs
index 244b0af..94f58b2 100644
--- a/src/math/line_segment.rs
+++ b/src/math/line_segment.rs
@@ -1,4 +1,4 @@
-use super::{Rect, TripletOrientation, Vec2};
+use super::{Rect, Surface, TripletOrientation, Vec2};
use alga::general::{ClosedDiv, ClosedMul, ClosedSub};
use nalgebra::{RealField, Scalar};
use num_traits::Zero;
@@ -118,8 +118,8 @@ impl<T: Scalar + Copy> LineSegment<T> {
* the segments. We know it's on the lines, so checking with the lines bounding box is
* faster than checking where on the line exactly it would be.
*/
- if Rect::bounding_rect(line_a.start, line_a.end).contains(out)
- && Rect::bounding_rect(line_b.start, line_b.end).contains(out)
+ if Rect::bounding_rect(line_a.start, line_a.end).contains_point(&out)
+ && Rect::bounding_rect(line_b.start, line_b.end).contains_point(&out)
{
Some(out)
} else {