From 923c98f4eca90ab27bf18f59d5b0575ca5b159bc Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 2 Feb 2020 21:26:36 +0100 Subject: [PATCH] partial revert:pictureviewer: fix logic,picture can be bigger than display Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a85ccd9191bfb7c7a04443d8279a006aa9aa29df Author: Jacek Jendrzej Date: 2020-02-02 (Sun, 02 Feb 2020) --- src/driver/pictureviewer/pictureviewer.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/driver/pictureviewer/pictureviewer.cpp b/src/driver/pictureviewer/pictureviewer.cpp index d1a7f74fa..93619822d 100644 --- a/src/driver/pictureviewer/pictureviewer.cpp +++ b/src/driver/pictureviewer/pictureviewer.cpp @@ -327,9 +327,6 @@ void CPictureViewer::Zoom (float factor) return; } - int xs = CFrameBuffer::getInstance()->getScreenWidth(true); - int ys = CFrameBuffer::getInstance()->getScreenHeight(true); - if (m_CurrentPic_X < (m_endx - m_startx)) m_CurrentPic_XPos = (m_endx - m_startx - m_CurrentPic_X) / 2 + m_startx; else @@ -338,11 +335,11 @@ void CPictureViewer::Zoom (float factor) m_CurrentPic_YPos = (m_endy - m_starty - m_CurrentPic_Y) / 2 + m_starty; else m_CurrentPic_YPos = m_starty; - if ((m_endx - m_startx) > xs) + if (m_CurrentPic_X > (m_endx - m_startx)) m_CurrentPic_XPan = (m_CurrentPic_X - (m_endx - m_startx)) / 2; else m_CurrentPic_XPan = 0; - if ((m_endy - m_starty) > ys) + if (m_CurrentPic_Y > (m_endy - m_starty)) m_CurrentPic_YPan = (m_CurrentPic_Y - (m_endy - m_starty)) / 2; else m_CurrentPic_YPan = 0;