diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2015-12-04 04:01:44 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2015-12-04 04:01:44 +0530 |
commit | 68922e0ac2e36d10dd5f079ecae5de7c07cd1253 (patch) | |
tree | 163b9d5acc4592b8dfee061ee9b3d4b62fbe9a1e /components/util/geometry.rs | |
parent | bc62b5aadb62267582fbd65daa28438ce6c6ac9c (diff) | |
parent | 96a8b442b856ab41c088eb7d1911842a703a7484 (diff) | |
download | servo-68922e0ac2e36d10dd5f079ecae5de7c07cd1253.tar.gz servo-68922e0ac2e36d10dd5f079ecae5de7c07cd1253.zip |
Auto merge of #8797 - cheba:rect-contains, r=Manishearth
Replaced rect_contains_point with Rect.contains()
This is a proposed in servo/servo#8791 clean up.
Fixes #8791.
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8797)
<!-- Reviewable:end -->
Diffstat (limited to 'components/util/geometry.rs')
-rw-r--r-- | components/util/geometry.rs | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/components/util/geometry.rs b/components/util/geometry.rs index d9599a11369..4d89a817853 100644 --- a/components/util/geometry.rs +++ b/components/util/geometry.rs @@ -75,16 +75,6 @@ pub static MAX_RECT: Rect<Au> = Rect { } }; -/// Returns true if the rect contains the given point. Points on the top or left sides of the rect -/// are considered inside the rectangle, while points on the right or bottom sides of the rect are -/// not considered inside the rectangle. -pub fn rect_contains_point<T>(rect: Rect<T>, point: Point2D<T>) -> bool - where T: PartialOrd + Add<T, Output=T> -{ - point.x >= rect.origin.x && point.x < rect.origin.x + rect.size.width && - point.y >= rect.origin.y && point.y < rect.origin.y + rect.size.height -} - /// A helper function to convert a rect of `f32` pixels to a rect of app units. pub fn f32_rect_to_au_rect(rect: Rect<f32>) -> Rect<Au> { Rect::new(Point2D::new(Au::from_f32_px(rect.origin.x), Au::from_f32_px(rect.origin.y)), |