mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
auto merge of #4357 : pcwalton/servo/compositor-hit-test-clipping, r=mrobinson
Fixes clicking on links on the second page of Hacker News. r? @mrobinson
This commit is contained in:
commit
251dbb37ed
1 changed files with 9 additions and 4 deletions
|
@ -1125,9 +1125,12 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
|
||||
let child_point = point - layer_bounds.origin;
|
||||
for child in layer.children().iter().rev() {
|
||||
// Translate the clip rect into the child's coordinate system.
|
||||
let clip_rect_for_child =
|
||||
clip_rect_for_children.translate(&-*child.content_offset.borrow());
|
||||
let result = self.find_topmost_layer_at_point_for_layer(child.clone(),
|
||||
child_point,
|
||||
&clip_rect_for_children);
|
||||
&clip_rect_for_child);
|
||||
if result.is_some() {
|
||||
return result;
|
||||
}
|
||||
|
@ -1145,9 +1148,11 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
point: TypedPoint2D<LayerPixel, f32>)
|
||||
-> Option<HitTestResult> {
|
||||
match self.scene.root {
|
||||
Some(ref layer) => self.find_topmost_layer_at_point_for_layer(layer.clone(),
|
||||
point,
|
||||
&*layer.bounds.borrow()),
|
||||
Some(ref layer) => {
|
||||
self.find_topmost_layer_at_point_for_layer(layer.clone(),
|
||||
point,
|
||||
&*layer.bounds.borrow())
|
||||
}
|
||||
|
||||
None => None,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue