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

LibWeb: Add LayoutNode::frame() reference getter

Any live layout tree always has a corresponding live Frame, as we will
never create a layout tree for a frameless document.
This commit is contained in:
Andreas Kling 2020-06-14 16:45:45 +02:00
parent a93fb7299f
commit 62615dfc31
5 changed files with 19 additions and 11 deletions

View file

@ -60,7 +60,7 @@ void LayoutWidget::did_set_rect()
void LayoutWidget::update_widget()
{
auto adjusted_widget_position = absolute_rect().location().to_int_point();
auto& page_view = static_cast<const PageView&>(document().frame()->page().client());
auto& page_view = static_cast<const PageView&>(frame().page().client());
adjusted_widget_position.move_by(-page_view.horizontal_scrollbar().value(), -page_view.vertical_scrollbar().value());
widget().move_to(adjusted_widget_position);
}