Backwards thumbnail selection using Shift-key unexpectedly shifts starting point of selection, fixes #5389
This commit is contained in:
@@ -178,15 +178,19 @@ void ThumbBrowserBase::selectRange (ThumbBrowserEntryBase* clicked, bool additio
|
|||||||
if (!additional || !lastClicked) {
|
if (!additional || !lastClicked) {
|
||||||
// Extend the current range w.r.t to first selected entry.
|
// Extend the current range w.r.t to first selected entry.
|
||||||
ThumbIterator front = std::find(fd.begin(), fd.end(), selected.front());
|
ThumbIterator front = std::find(fd.begin(), fd.end(), selected.front());
|
||||||
|
ThumbIterator back;
|
||||||
ThumbIterator current = std::find(fd.begin(), fd.end(), clicked);
|
ThumbIterator current = std::find(fd.begin(), fd.end(), clicked);
|
||||||
|
|
||||||
if (front > current) {
|
if (front > current) {
|
||||||
std::swap(front, current);
|
front = current;
|
||||||
|
back = std::find(fd.begin(), fd.end(), selected.back());
|
||||||
|
} else {
|
||||||
|
back = current;
|
||||||
}
|
}
|
||||||
|
|
||||||
clearSelection(selected);
|
clearSelection(selected);
|
||||||
|
|
||||||
for (; front <= current && front != fd.end(); ++front) {
|
for (; front <= back && front != fd.end(); ++front) {
|
||||||
addToSelection(*front, selected);
|
addToSelection(*front, selected);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user