1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +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

@ -566,28 +566,6 @@ void WebContentView::set_preferred_color_scheme(Web::CSS::PreferredColorScheme c
client().async_set_preferred_color_scheme(color_scheme);
}
void WebContentView::zoom_in()
{
if (m_zoom_level >= ZOOM_MAX_LEVEL)
return;
m_zoom_level += ZOOM_STEP;
update_zoom();
}
void WebContentView::zoom_out()
{
if (m_zoom_level <= ZOOM_MIN_LEVEL)
return;
m_zoom_level -= ZOOM_STEP;
update_zoom();
}
void WebContentView::reset_zoom()
{
m_zoom_level = 1.0f;
update_zoom();
}
void WebContentView::update_zoom()
{
client().async_set_device_pixels_per_css_pixel(m_device_pixel_ratio * m_zoom_level);