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

LibWebView+Ladybird: Move zoom logic to ViewImplementation

This commit is contained in:
Linus Groh 2023-01-12 19:49:49 +00:00 committed by Andreas Kling
parent 5411adca22
commit 5d9f4b2ffc
6 changed files with 36 additions and 67 deletions

View file

@ -159,28 +159,6 @@ void OutOfProcessWebView::handle_resize()
request_repaint();
}
void OutOfProcessWebView::zoom_in()
{
if (m_zoom_level >= ZOOM_MAX_LEVEL)
return;
m_zoom_level += ZOOM_STEP;
update_zoom();
}
void OutOfProcessWebView::zoom_out()
{
if (m_zoom_level <= ZOOM_MIN_LEVEL)
return;
m_zoom_level -= ZOOM_STEP;
update_zoom();
}
void OutOfProcessWebView::reset_zoom()
{
m_zoom_level = 1.0f;
update_zoom();
}
void OutOfProcessWebView::update_zoom()
{
client().async_set_device_pixels_per_css_pixel(m_device_pixel_ratio * m_zoom_level);