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:
parent
5411adca22
commit
5d9f4b2ffc
6 changed files with 36 additions and 67 deletions
|
@ -20,4 +20,26 @@ WebContentClient const& ViewImplementation::client() const
|
|||
return *m_client_state.client;
|
||||
}
|
||||
|
||||
void ViewImplementation::zoom_in()
|
||||
{
|
||||
if (m_zoom_level >= ZOOM_MAX_LEVEL)
|
||||
return;
|
||||
m_zoom_level += ZOOM_STEP;
|
||||
update_zoom();
|
||||
}
|
||||
|
||||
void ViewImplementation::zoom_out()
|
||||
{
|
||||
if (m_zoom_level <= ZOOM_MIN_LEVEL)
|
||||
return;
|
||||
m_zoom_level -= ZOOM_STEP;
|
||||
update_zoom();
|
||||
}
|
||||
|
||||
void ViewImplementation::reset_zoom()
|
||||
{
|
||||
m_zoom_level = 1.0f;
|
||||
update_zoom();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue