mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Use WebRender to compute text index on click events
This is the second half of switching over to WebRender for hit testing. Now that WebRender gives us the location of the hit tested point in the display item, we can use that to calculate text index.
This commit is contained in:
@@ -2187,8 +2187,15 @@ impl ScriptThread {
|
||||
self.handle_resize_event(pipeline_id, new_size, size_type);
|
||||
}
|
||||
|
||||
MouseButtonEvent(event_type, button, point, node_address) => {
|
||||
self.handle_mouse_event(pipeline_id, event_type, button, point, node_address);
|
||||
MouseButtonEvent(event_type, button, point, node_address, point_in_node) => {
|
||||
self.handle_mouse_event(
|
||||
pipeline_id,
|
||||
event_type,
|
||||
button,
|
||||
point,
|
||||
node_address,
|
||||
point_in_node
|
||||
);
|
||||
}
|
||||
|
||||
MouseMoveEvent(point, node_address) => {
|
||||
@@ -2299,7 +2306,8 @@ impl ScriptThread {
|
||||
mouse_event_type: MouseEventType,
|
||||
button: MouseButton,
|
||||
point: Point2D<f32>,
|
||||
node_address: Option<UntrustedNodeAddress>
|
||||
node_address: Option<UntrustedNodeAddress>,
|
||||
point_in_node: Option<Point2D<f32>>
|
||||
) {
|
||||
let document = match { self.documents.borrow().find_document(pipeline_id) } {
|
||||
Some(document) => document,
|
||||
@@ -2310,7 +2318,8 @@ impl ScriptThread {
|
||||
button,
|
||||
point,
|
||||
mouse_event_type,
|
||||
node_address
|
||||
node_address,
|
||||
point_in_node
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user