mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Simplify the code setting hit_test_response.
This commit is contained in:
parent
aefa941626
commit
ae064dc7c1
1 changed files with 5 additions and 11 deletions
|
@ -1156,17 +1156,11 @@ impl LayoutThread {
|
|||
},
|
||||
ReflowQueryType::HitTestQuery(point, update_cursor) => {
|
||||
let point = Point2D::new(Au::from_f32_px(point.x), Au::from_f32_px(point.y));
|
||||
let result = match rw_data.display_list {
|
||||
None => panic!("Tried to hit test with no display list"),
|
||||
Some(ref display_list) => {
|
||||
display_list.hit_test(&point, &rw_data.stacking_context_scroll_offsets)
|
||||
}
|
||||
};
|
||||
rw_data.hit_test_response = if result.len() > 0 {
|
||||
(Some(result[0]), update_cursor)
|
||||
} else {
|
||||
(None, update_cursor)
|
||||
};
|
||||
let result = rw_data.display_list
|
||||
.as_ref()
|
||||
.expect("Tried to hit test with no display list")
|
||||
.hit_test(&point, &rw_data.stacking_context_scroll_offsets);
|
||||
rw_data.hit_test_response = (result.get(0).cloned(), update_cursor);
|
||||
},
|
||||
ReflowQueryType::NodeGeometryQuery(node) => {
|
||||
let node = unsafe { ServoLayoutNode::new(&node) };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue