mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
fix #22075
Combined on_scroll_window_event with on_scroll_start_window_event and on_scroll_end_window_event
This commit is contained in:
parent
ba1ed11ced
commit
e3e391b09c
1 changed files with 2 additions and 33 deletions
|
@ -166,9 +166,6 @@ pub struct IOCompositor<Window: WindowMethods> {
|
|||
/// image for the reftest framework.
|
||||
ready_to_save_state: ReadyState,
|
||||
|
||||
/// Whether a scroll is in progress; i.e. whether the user's fingers are down.
|
||||
scroll_in_progress: bool,
|
||||
|
||||
in_scroll_transaction: Option<Instant>,
|
||||
|
||||
/// The webrender renderer.
|
||||
|
@ -852,10 +849,10 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
match phase {
|
||||
TouchEventType::Move => self.on_scroll_window_event(delta, cursor),
|
||||
TouchEventType::Up | TouchEventType::Cancel => {
|
||||
self.on_scroll_end_window_event(delta, cursor);
|
||||
self.on_scroll_window_event(delta, cursor);
|
||||
},
|
||||
TouchEventType::Down => {
|
||||
self.on_scroll_start_window_event(delta, cursor);
|
||||
self.on_scroll_window_event(delta, cursor);
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -870,34 +867,6 @@ impl<Window: WindowMethods> IOCompositor<Window> {
|
|||
});
|
||||
}
|
||||
|
||||
fn on_scroll_start_window_event(
|
||||
&mut self,
|
||||
scroll_location: ScrollLocation,
|
||||
cursor: DeviceIntPoint,
|
||||
) {
|
||||
self.scroll_in_progress = true;
|
||||
self.pending_scroll_zoom_events.push(ScrollZoomEvent {
|
||||
magnification: 1.0,
|
||||
scroll_location: scroll_location,
|
||||
cursor: cursor,
|
||||
event_count: 1,
|
||||
});
|
||||
}
|
||||
|
||||
fn on_scroll_end_window_event(
|
||||
&mut self,
|
||||
scroll_location: ScrollLocation,
|
||||
cursor: DeviceIntPoint,
|
||||
) {
|
||||
self.scroll_in_progress = false;
|
||||
self.pending_scroll_zoom_events.push(ScrollZoomEvent {
|
||||
magnification: 1.0,
|
||||
scroll_location: scroll_location,
|
||||
cursor: cursor,
|
||||
event_count: 1,
|
||||
});
|
||||
}
|
||||
|
||||
fn process_pending_scroll_events(&mut self) {
|
||||
let had_events = self.pending_scroll_zoom_events.len() > 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue