From aa379308e31bd159c165bd830694a12ef72708d6 Mon Sep 17 00:00:00 2001 From: Morgan Hardwood Date: Mon, 1 Apr 2019 12:46:56 +0200 Subject: [PATCH] Tweaked filmstrip scrolling to be less jumpy Now the centering a thumb happens only if less than half of the next/prev thumbnail is visible. #5174 --- rtgui/filebrowser.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index f08e6114d..7802e9987 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -1779,7 +1779,7 @@ void FileBrowser::openNextImage() // scroll only when selected[0] is outside of the displayed bounds // or less than a thumbnail's width from either edge. - if ((x2 > x1 + ww - 2 * tw) || (x2 - tw < x1)) { + if ((x2 > x1 + ww - 1.5 * tw) || (x2 - tw / 2 < x1)) { setScrollPosition(x2 - (ww - tw) / 2, y2); } @@ -1842,7 +1842,7 @@ void FileBrowser::openPrevImage() // scroll only when selected[0] is outside of the displayed bounds // or less than a thumbnail's width from either edge. - if ((x2 > x1 + ww - 2 * tw) || (x2 - tw < x1)) { + if ((x2 > x1 + ww - 1.5 * tw) || (x2 - tw / 2 < x1)) { setScrollPosition(x2 - (ww - tw) / 2, y2); }