mirror of
https://github.com/servo/servo.git
synced 2025-10-04 02:29:12 +01:00
libservo: Remove TouchEventType
argument from WebView::notify_scroll_event
(#37588)
The compositor always does the same thing with these events regardless of the phase, so I think it is completely unecessary. Testing: This shouldn't change behavior at all, so is covered by existing tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
ce4da2bf97
commit
80a7de8c9c
7 changed files with 26 additions and 55 deletions
|
@ -588,7 +588,7 @@ impl WindowPortsMethods for Window {
|
|||
webview.notify_input_event(InputEvent::MouseLeave(MouseLeaveEvent::new(point)));
|
||||
}
|
||||
},
|
||||
WindowEvent::MouseWheel { delta, phase, .. } => {
|
||||
WindowEvent::MouseWheel { delta, .. } => {
|
||||
let (mut dx, mut dy, mode) = match delta {
|
||||
MouseScrollDelta::LineDelta(dx, dy) => {
|
||||
(dx as f64, (dy * LINE_HEIGHT) as f64, WheelMode::DeltaLine)
|
||||
|
@ -618,11 +618,10 @@ impl WindowPortsMethods for Window {
|
|||
}
|
||||
|
||||
let scroll_location = ScrollLocation::Delta(Vector2D::new(dx as f32, dy as f32));
|
||||
let phase = winit_phase_to_touch_event_type(phase);
|
||||
|
||||
// Send events
|
||||
webview.notify_input_event(InputEvent::Wheel(WheelEvent::new(delta, point)));
|
||||
webview.notify_scroll_event(scroll_location, point.to_i32(), phase);
|
||||
webview.notify_scroll_event(scroll_location, point.to_i32());
|
||||
},
|
||||
WindowEvent::Touch(touch) => {
|
||||
webview.notify_input_event(InputEvent::Touch(TouchEvent::new(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue