Solving issue 1096: "Infinite loop when switching to before/after view"

This commit is contained in:
Hombre
2011-12-28 12:23:56 +01:00
parent 516b14cf04
commit 91ea850701

View File

@@ -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)