mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-11 01:06:01 +03:00
ImageViewer: Use scaled image size when resizing window to fit it
When the image is flipped or rotated, the window is resized to ensure that the image still fits in the frame. However, currently the original bitmap rect is used, which doesn't take into account the scaling factor. Fix this by using the scaled rect instead.
This commit is contained in:
parent
05d7ac1193
commit
72f1e23e6b
Notes:
sideshowbarker
2024-07-18 02:09:54 +09:00
Author: https://github.com/nfraprado 🔰 Commit: https://github.com/SerenityOS/serenity/commit/72f1e23e6be Pull-request: https://github.com/SerenityOS/serenity/pull/10539
@ -299,7 +299,7 @@ void ViewWidget::resize_window()
|
|||||||
if (!m_bitmap)
|
if (!m_bitmap)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto new_size = m_bitmap->size();
|
auto new_size = m_bitmap_rect.size();
|
||||||
|
|
||||||
if (new_size.width() < 300)
|
if (new_size.width() < 300)
|
||||||
new_size.set_width(300);
|
new_size.set_width(300);
|
||||||
|
Loading…
Reference in New Issue
Block a user