mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibWeb: Add Page abstraction between PageView and main Frame
* A PageView is a view onto a Page object. * A Page always has a main Frame (root of Frame tree.) * Page has a PageClient. PageView is a PageClient. The goal here is to allow building another kind of view onto a Page while keeping the rest of LibWeb intact.
This commit is contained in:
@@ -60,8 +60,8 @@ void LayoutWidget::did_set_rect()
|
||||
void LayoutWidget::update_widget()
|
||||
{
|
||||
auto adjusted_widget_position = rect().location().to_int_point();
|
||||
if (auto* page_view = document().frame()->page_view())
|
||||
adjusted_widget_position.move_by(-page_view->horizontal_scrollbar().value(), -page_view->vertical_scrollbar().value());
|
||||
auto& page_view = static_cast<const PageView&>(document().frame()->page().client());
|
||||
adjusted_widget_position.move_by(-page_view.horizontal_scrollbar().value(), -page_view.vertical_scrollbar().value());
|
||||
widget().move_to(adjusted_widget_position);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user