mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Auto merge of #9866 - metajack:refix-shadow-hit-test, r=pcwalton
Unrevert the fix for hit testing through shadows This was originally #9428 but got accidentally reverted during rebase in Fixes #9865. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9866) <!-- Reviewable:end -->
This commit is contained in:
commit
12466b8706
1 changed files with 19 additions and 12 deletions
|
@ -1314,23 +1314,30 @@ impl DisplayItem {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if let DisplayItem::BorderClass(ref border) = *self {
|
match *self {
|
||||||
// If the point is inside the border, it didn't hit the border!
|
DisplayItem::BorderClass(ref border) => {
|
||||||
let interior_rect =
|
// If the point is inside the border, it didn't hit the border!
|
||||||
Rect::new(
|
let interior_rect =
|
||||||
Point2D::new(border.base.bounds.origin.x +
|
Rect::new(
|
||||||
border.border_widths.left,
|
Point2D::new(border.base.bounds.origin.x +
|
||||||
border.base.bounds.origin.y +
|
border.border_widths.left,
|
||||||
border.border_widths.top),
|
border.base.bounds.origin.y +
|
||||||
Size2D::new(border.base.bounds.size.width -
|
border.border_widths.top),
|
||||||
|
Size2D::new(border.base.bounds.size.width -
|
||||||
(border.border_widths.left +
|
(border.border_widths.left +
|
||||||
border.border_widths.right),
|
border.border_widths.right),
|
||||||
border.base.bounds.size.height -
|
border.base.bounds.size.height -
|
||||||
(border.border_widths.top +
|
(border.border_widths.top +
|
||||||
border.border_widths.bottom)));
|
border.border_widths.bottom)));
|
||||||
if interior_rect.contains(&point) {
|
if interior_rect.contains(&point) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
DisplayItem::BoxShadowClass(_) => {
|
||||||
|
// Box shadows can never be hit.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We found a hit!
|
// We found a hit!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue