summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-07-08 13:12:23 +0200
committerAndrew Kaster <andrewdkaster@gmail.com>2022-12-25 07:58:58 -0700
commitb97c74331cb00c56cd8bf7ffba17efedbbe5d009 (patch)
treeeda0de3576c5ec60d465241ad9a1f29344523545
parenta08e83e2cc271e2d5bf3720798723b2f8eafc0bf (diff)
downloadserenity-b97c74331cb00c56cd8bf7ffba17efedbbe5d009.zip
Ladybird: Don't include scrollbars in viewport rect size
-rw-r--r--Ladybird/WebView.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Ladybird/WebView.cpp b/Ladybird/WebView.cpp
index f54821252e..3769a15abe 100644
--- a/Ladybird/WebView.cpp
+++ b/Ladybird/WebView.cpp
@@ -407,6 +407,10 @@ void WebView::resizeEvent(QResizeEvent* event)
auto scaled_width = int(event->size().width() / 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);
+ 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);
}