mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 11:35:07 +00:00
Ladybird: Don't include scrollbars in viewport rect size
This commit is contained in:
parent
a08e83e2cc
commit
b97c74331c
1 changed files with 4 additions and 0 deletions
|
@ -407,6 +407,10 @@ void WebView::resizeEvent(QResizeEvent* event)
|
||||||
auto scaled_width = int(event->size().width() / m_inverse_pixel_scaling_ratio);
|
auto scaled_width = int(event->size().width() / m_inverse_pixel_scaling_ratio);
|
||||||
auto scaled_height = int(event->size().height() / m_inverse_pixel_scaling_ratio);
|
auto scaled_height = int(event->size().height() / m_inverse_pixel_scaling_ratio);
|
||||||
Gfx::IntRect rect(horizontalScrollBar()->value(), verticalScrollBar()->value(), scaled_width, scaled_height);
|
Gfx::IntRect rect(horizontalScrollBar()->value(), verticalScrollBar()->value(), scaled_width, scaled_height);
|
||||||
|
if (verticalScrollBar()->isVisible())
|
||||||
|
rect.set_width(rect.width() - verticalScrollBar()->width());
|
||||||
|
if (horizontalScrollBar()->isVisible())
|
||||||
|
rect.set_height(rect.height() - horizontalScrollBar()->height());
|
||||||
m_page_client->set_viewport_rect(rect);
|
m_page_client->set_viewport_rect(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue