mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Ladybird/WebView: Fix size calculation in update_viewport_rect()
size() may include the dimensions of the scrollbars, so we now use viewport() instead.
This commit is contained in:
parent
22c3b8be7b
commit
02b3a89d96
Notes:
sideshowbarker
2024-07-17 02:42:22 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/02b3a89d96 Pull-request: https://github.com/SerenityOS/serenity/pull/16583 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/awesomekling ✅ Reviewed-by: https://github.com/linusg
1 changed files with 2 additions and 2 deletions
|
@ -405,8 +405,8 @@ void SimpleWebView::resizeEvent(QResizeEvent* event)
|
|||
|
||||
void SimpleWebView::update_viewport_rect()
|
||||
{
|
||||
auto scaled_width = int(size().width() / m_inverse_pixel_scaling_ratio);
|
||||
auto scaled_height = int(size().height() / m_inverse_pixel_scaling_ratio);
|
||||
auto scaled_width = int(viewport()->size().width() / m_inverse_pixel_scaling_ratio);
|
||||
auto scaled_height = int(viewport()->size().height() / m_inverse_pixel_scaling_ratio);
|
||||
Gfx::IntRect rect(horizontalScrollBar()->value(), verticalScrollBar()->value(), scaled_width, scaled_height);
|
||||
m_page_client->set_viewport_rect(rect);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue