mirror of
https://github.com/maplibre/maplibre-rs.git
synced 2025-12-08 19:05:57 +00:00
Allow panning with touch inputs (#130)
* Allow panning with touch inputs * Fix code formatting Co-authored-by: Max Ammann <max@maxammann.org>
This commit is contained in:
parent
f0f244ee65
commit
2b13668727
@ -91,7 +91,9 @@ impl InputController {
|
||||
}
|
||||
WindowEvent::Touch(touch) => match touch.phase {
|
||||
TouchPhase::Started => {
|
||||
self.pan_handler.process_touch_start();
|
||||
let position: (f64, f64) = touch.location.to_owned().into();
|
||||
self.pan_handler
|
||||
.process_touch_start(&Vector2::from(position));
|
||||
self.query_handler.process_touch_start();
|
||||
true
|
||||
}
|
||||
|
||||
@ -67,8 +67,9 @@ impl PanHandler {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn process_touch_start(&mut self) -> bool {
|
||||
pub fn process_touch_start(&mut self, window_position: &Vector2<f64>) -> bool {
|
||||
self.is_panning = true;
|
||||
self.start_window_position = Some(*window_position);
|
||||
true
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user