mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Improve scrolling speed in servoshell. (#34063)
Servo was previously using the inverse of the correct scale factor which could cause the scrolling speed to be 4x too slow on a machine with scale factor of 2.0 Signed-off-by: Nico Burns <nico@nicoburns.com>
This commit is contained in:
parent
635c10a941
commit
78ba1613d4
1 changed files with 3 additions and 3 deletions
|
@ -24,7 +24,7 @@ use servo::webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize};
|
|||
use servo::webrender_api::ScrollLocation;
|
||||
use servo::webrender_traits::RenderingContext;
|
||||
use surfman::{Connection, Context, Device, SurfaceType};
|
||||
use winit::dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize};
|
||||
use winit::dpi::{LogicalSize, PhysicalPosition, PhysicalSize};
|
||||
use winit::event::{ElementState, KeyEvent, MouseButton, MouseScrollDelta, TouchPhase};
|
||||
use winit::keyboard::{Key as LogicalKey, ModifiersState, NamedKey};
|
||||
#[cfg(any(target_os = "linux", target_os = "windows"))]
|
||||
|
@ -423,8 +423,8 @@ impl WindowPortsMethods for Window {
|
|||
(dx as f64, (dy * LINE_HEIGHT) as f64, WheelMode::DeltaLine)
|
||||
},
|
||||
MouseScrollDelta::PixelDelta(position) => {
|
||||
let position: LogicalPosition<f64> =
|
||||
position.to_logical(self.device_hidpi_factor().get() as f64);
|
||||
let scale_factor = self.device_hidpi_factor().inverse().get() as f64;
|
||||
let position = position.to_logical(scale_factor);
|
||||
(position.x, position.y, WheelMode::DeltaPixel)
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue