From 91ea85070105ceb36160bc6af0d86aead1c5b22d Mon Sep 17 00:00:00 2001 From: Hombre Date: Wed, 28 Dec 2011 12:23:56 +0100 Subject: [PATCH] Solving issue 1096: "Infinite loop when switching to before/after view" --- rtgui/imageareapanel.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rtgui/imageareapanel.cc b/rtgui/imageareapanel.cc index c82625f62..b19a3f1ba 100644 --- a/rtgui/imageareapanel.cc +++ b/rtgui/imageareapanel.cc @@ -88,14 +88,17 @@ void ImageAreaPanel::configScrollBars () { hscroll->set_value (x); vscroll->set_value (y); - if(iw>=imgw) + // A "gray zone" where scrollbars stays displayed/hidden between imgw and imgw+30 + // has been introduced to avoid infinite loop. 30px should be enough and represent + // the width of the scrollbar + if(iw >= (imgw+30)) hscroll->hide(); - else + else if(iw < imgw) hscroll->show(); - if(ih>=imgh) + if(ih >= (imgh+30)) vscroll->hide(); - else + else if(ih < imgh) vscroll->show(); if (before && this==after)