mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-02 12:30:31 +00:00
LibWebView: Unbreak content-scales-to-viewport mode for Presenter
Now that we allocate an oversized backing store during resizing of the
viewport, we need to constrain the source rect used when drawing a
scaled version of the content in the special mode used by Presenter.
Regressed with 85c542ab00
.
This commit is contained in:
parent
62c7fcd836
commit
f5f4daea9a
Notes:
sideshowbarker
2024-07-17 21:26:19 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f5f4daea9a Pull-request: https://github.com/SerenityOS/serenity/pull/19194
1 changed files with 10 additions and 3 deletions
|
@ -68,10 +68,17 @@ void OutOfProcessWebView::paint_event(GUI::PaintEvent& event)
|
|||
if (auto* bitmap = m_client_state.has_usable_bitmap ? m_client_state.front_bitmap.bitmap.ptr() : m_backup_bitmap.ptr()) {
|
||||
painter.add_clip_rect(frame_inner_rect());
|
||||
painter.translate(frame_thickness(), frame_thickness());
|
||||
if (m_content_scales_to_viewport)
|
||||
painter.draw_scaled_bitmap(rect(), *bitmap, bitmap->rect());
|
||||
else
|
||||
if (m_content_scales_to_viewport) {
|
||||
auto bitmap_rect = Gfx::IntRect {
|
||||
{},
|
||||
m_client_state.has_usable_bitmap
|
||||
? m_client_state.front_bitmap.last_painted_size
|
||||
: m_backup_bitmap_size
|
||||
};
|
||||
painter.draw_scaled_bitmap(rect(), *bitmap, bitmap_rect);
|
||||
} else {
|
||||
painter.blit({ 0, 0 }, *bitmap, bitmap->rect());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue