Backwards thumbnail selection using Shift-key unexpectedly shifts starting point of selection, fixes #5389

This commit is contained in:
Ingo Weyrich
2019-07-27 11:40:01 +02:00
parent a9edbcf47b
commit 1320791052

View File

@@ -178,15 +178,19 @@ void ThumbBrowserBase::selectRange (ThumbBrowserEntryBase* clicked, bool additio
if (!additional || !lastClicked) {
// Extend the current range w.r.t to first selected entry.
ThumbIterator front = std::find(fd.begin(), fd.end(), selected.front());
ThumbIterator back;
ThumbIterator current = std::find(fd.begin(), fd.end(), clicked);
if (front > current) {
std::swap(front, current);
front = current;
back = std::find(fd.begin(), fd.end(), selected.back());
} else {
back = current;
}
clearSelection(selected);
for (; front <= current && front != fd.end(); ++front) {
for (; front <= back && front != fd.end(); ++front) {
addToSelection(*front, selected);
}
} else {