mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
QuickShow: Do not reset the panning on 100% zoom.
This commit is contained in:
parent
ee64c814c6
commit
33bd18f308
|
@ -48,7 +48,7 @@ void QSWidget::clear()
|
|||
m_bitmap = nullptr;
|
||||
m_path = {};
|
||||
|
||||
set_scale(100);
|
||||
reset_view();
|
||||
update();
|
||||
}
|
||||
|
||||
|
@ -134,9 +134,6 @@ void QSWidget::set_scale(int scale)
|
|||
if (scale > 1000)
|
||||
scale = 1000;
|
||||
|
||||
if (scale == 100)
|
||||
m_pan_origin = { 0, 0 };
|
||||
|
||||
m_scale = scale;
|
||||
float scale_factor = (float)m_scale / 100.0f;
|
||||
|
||||
|
@ -256,7 +253,7 @@ void QSWidget::load_from_file(const String& path)
|
|||
m_path = path;
|
||||
m_bitmap = bitmap;
|
||||
m_scale = -1;
|
||||
set_scale(100);
|
||||
reset_view();
|
||||
}
|
||||
|
||||
void QSWidget::drop_event(GUI::DropEvent& event)
|
||||
|
@ -284,3 +281,9 @@ void QSWidget::resize_window()
|
|||
new_size.set_height(new_size.height() + m_toolbar_height);
|
||||
window()->resize(new_size);
|
||||
}
|
||||
|
||||
void QSWidget::reset_view()
|
||||
{
|
||||
m_pan_origin = { 0, 0 };
|
||||
set_scale(100);
|
||||
}
|
||||
|
|
|
@ -74,6 +74,7 @@ private:
|
|||
|
||||
void relayout();
|
||||
void resize_window();
|
||||
void reset_view();
|
||||
|
||||
String m_path;
|
||||
RefPtr<Gfx::Bitmap> m_bitmap;
|
||||
|
|
Loading…
Reference in a new issue