From e350591b3f361975715bcb29e2ade5b59883f0c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Sat, 16 May 2020 22:53:12 +0200 Subject: [PATCH] Implement oneToOne() and bestFit() --- imagescrollareagl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/imagescrollareagl.cpp b/imagescrollareagl.cpp index 223fa38..eebb6dd 100644 --- a/imagescrollareagl.cpp +++ b/imagescrollareagl.cpp @@ -329,12 +329,14 @@ void ImageScrollAreaGL::zoomOut() void ImageScrollAreaGL::bestFit() { - + m_scale = std::min((float)m_imageWidget->width()/m_imgWidth, (float)m_imageWidget->height()/m_imgHeight); + zoom(0.0f); } void ImageScrollAreaGL::oneToOne() { - + m_scale = 1.0f; + zoom(0.0f); } void ImageScrollAreaGL::scrollEvent()