mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Use a where clause for rect_contains_point to bring the line under 100 columns.
This commit is contained in:
parent
dcd207f9bf
commit
d20ef3b6d8
1 changed files with 3 additions and 1 deletions
|
@ -89,7 +89,9 @@ 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: PartialOrd + Add<T, Output=T>>(rect: Rect<T>, point: Point2D<T>) -> bool {
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue