mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
parent
d34641dc3f
commit
32a68a43ec
2 changed files with 47 additions and 16 deletions
|
@ -390,23 +390,30 @@ impl DisplayList {
|
|||
return;
|
||||
}
|
||||
|
||||
if let DisplayItem::BorderClass(ref border) = *item {
|
||||
// If the point is inside the border, it didn't hit the border!
|
||||
let interior_rect =
|
||||
Rect::new(
|
||||
Point2D::new(border.base.bounds.origin.x +
|
||||
border.border_widths.left,
|
||||
border.base.bounds.origin.y +
|
||||
border.border_widths.top),
|
||||
Size2D::new(border.base.bounds.size.width -
|
||||
(border.border_widths.left +
|
||||
border.border_widths.right),
|
||||
border.base.bounds.size.height -
|
||||
(border.border_widths.top +
|
||||
border.border_widths.bottom)));
|
||||
if interior_rect.contains(&point) {
|
||||
return;
|
||||
match *item {
|
||||
DisplayItem::BorderClass(ref border) => {
|
||||
// If the point is inside the border, it didn't hit the border!
|
||||
let interior_rect =
|
||||
Rect::new(
|
||||
Point2D::new(border.base.bounds.origin.x +
|
||||
border.border_widths.left,
|
||||
border.base.bounds.origin.y +
|
||||
border.border_widths.top),
|
||||
Size2D::new(border.base.bounds.size.width -
|
||||
(border.border_widths.left +
|
||||
border.border_widths.right),
|
||||
border.base.bounds.size.height -
|
||||
(border.border_widths.top +
|
||||
border.border_widths.bottom)));
|
||||
if interior_rect.contains(&point) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
DisplayItem::BoxShadowClass(_) => {
|
||||
// Box shadows can never be hit.
|
||||
return
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
// We found a hit!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue