mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
headless-browser: Split the setters for the screen and the viewport rect
These two represent different things, and should be handled by different methods.
This commit is contained in:
parent
9c431ede7a
commit
9e5af374d0
1 changed files with 6 additions and 1 deletions
|
@ -94,10 +94,14 @@ public:
|
|||
m_palette_impl = Gfx::PaletteImpl::create_with_anonymous_buffer(theme_buffer);
|
||||
}
|
||||
|
||||
void set_viewport_rect(Gfx::IntRect viewport_rect)
|
||||
{
|
||||
page().top_level_browsing_context().set_viewport_rect(viewport_rect);
|
||||
}
|
||||
|
||||
void set_screen_rect(Gfx::IntRect screen_rect)
|
||||
{
|
||||
m_screen_rect = screen_rect;
|
||||
page().top_level_browsing_context().set_viewport_rect(screen_rect);
|
||||
}
|
||||
|
||||
// ^Web::PageClient
|
||||
|
@ -705,6 +709,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
page_client->load(AK::URL(url));
|
||||
|
||||
// FIXME: Allow passing these values as arguments
|
||||
page_client->set_viewport_rect({ 0, 0, 800, 600 });
|
||||
page_client->set_screen_rect({ 0, 0, 800, 600 });
|
||||
|
||||
dbgln("Taking screenshot after {} seconds !", take_screenshot_after);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue