diff options
| author | Arne Dußin | 2020-11-21 20:55:47 +0100 |
|---|---|---|
| committer | Arne Dußin | 2020-11-21 20:55:47 +0100 |
| commit | abf55d8d46fc7d5cfccc9f778da6fca10b33d0cd (patch) | |
| tree | e2f849338a1ce9dfff44082fa7d6b8510385f6f9 /src/math/line_segment.rs | |
| parent | 58ca374fab6dd90c4d7415bdcc98add002274894 (diff) | |
| download | graf_karto-abf55d8d46fc7d5cfccc9f778da6fca10b33d0cd.tar.gz graf_karto-abf55d8d46fc7d5cfccc9f778da6fca10b33d0cd.zip | |
Move containment of points/ lines into trait
Diffstat (limited to 'src/math/line_segment.rs')
| -rw-r--r-- | src/math/line_segment.rs | 6 |
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 { |
