1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:08:10 +00:00

Ladybird/Qt: Don't use devicePixelRatio() directly

This commit is contained in:
Bastiaan van der Plaat 2023-12-12 22:32:49 +01:00 committed by Andreas Kling
parent 41a3c19cfe
commit 8b0abb8ded

View file

@ -338,8 +338,8 @@ void WebContentView::wheelEvent(QWheelEvent* event)
auto num_degrees = -event->angleDelta();
float delta_x = -num_degrees.x() / 120;
float delta_y = num_degrees.y() / 120;
auto step_x = delta_x * QApplication::wheelScrollLines() * devicePixelRatio();
auto step_y = delta_y * QApplication::wheelScrollLines() * devicePixelRatio();
auto step_x = delta_x * QApplication::wheelScrollLines() * m_device_pixel_ratio;
auto step_y = delta_y * QApplication::wheelScrollLines() * m_device_pixel_ratio;
int scroll_step_size = verticalScrollBar()->singleStep();
client().async_mouse_wheel(to_content_position(position), screen_position, button, buttons, modifiers, step_x * scroll_step_size, step_y * scroll_step_size);
}