fix(input): don't limit to closest handler

This commit is contained in:
Nova
2025-04-19 01:32:35 -07:00
parent 5ea147f9fe
commit c5dea3b7c9
4 changed files with 27 additions and 21 deletions

View File

@@ -146,8 +146,18 @@ impl MousePointer {
return;
}
let sorted_handlers = get_sorted_handlers(&self.pointer, distance_calculator);
self.pointer.set_handler_order(sorted_handlers.iter());
let mut handlers = get_sorted_handlers(&self.pointer, distance_calculator);
let first_distance = handlers
.first()
.map(|(_, distance)| *distance)
.unwrap_or(std::f32::NEG_INFINITY);
self.pointer.set_handler_order(
handlers
.iter()
.filter(|(handler, distance)| (distance - first_distance).abs() <= 0.001)
.map(|(handler, _)| handler),
);
}
pub fn send_keyboard_input(