Commit 3e00ef9 1 parent d932c50 commit 3e00ef9 Copy full SHA for 3e00ef9
File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,15 @@ impl<T> Contains<LineString<T>> for Polygon<T>
152
152
}
153
153
}
154
154
155
+
156
+ impl < T > Contains < Point < T > > for Bbox < T >
157
+ where T : Float
158
+ {
159
+ fn contains ( & self , p : & Point < T > ) -> bool {
160
+ p. x ( ) >= self . xmin && p. x ( ) <= self . xmax && p. y ( ) >= self . ymin && p. y ( ) <= self . ymax
161
+ }
162
+ }
163
+
155
164
impl < T > Contains < Bbox < T > > for Bbox < T >
156
165
where T : Float
157
166
{
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ impl<T> Intersects<Bbox<T>> for Bbox<T>
73
73
{
74
74
fn intersects ( & self , bbox : & Bbox < T > ) -> bool {
75
75
// line intersects inner or outer polygon edge
76
- if bbox. contains ( & self ) {
76
+ if bbox. contains ( self ) {
77
77
return false
78
78
} else {
79
79
( self . xmin >= bbox. xmin && self . xmin <= bbox. xmax || self . xmax >= bbox. xmin && self . xmax <= bbox. xmax ) &&
You can’t perform that action at this time.
0 commit comments