ui/winui/table.cpp

branch
newapi
changeset 216
391c2c723029
parent 215
1bd5534c395d
child 218
d06e7e8e53e1
--- a/ui/winui/table.cpp	Fri Oct 13 15:20:54 2023 +0200
+++ b/ui/winui/table.cpp	Fri Oct 13 19:53:21 2023 +0200
@@ -320,13 +320,18 @@
 							// select everything between the first selection and the current row
 							std::sort(selection.begin(), selection.end());
 							int first = selection.front();
+							int last = row;
+							if (first > row) {
+								last = first;
+								first = row;
+							}
 
 							// clear previous selection
 							change_rows_bg(selection, defaultBrush, defaultBrush);
 
 							// create new selection
 							std::vector<int> newselection;
-							for (int s = first; s <= row; s++) {
+							for (int s = first; s <= last; s++) {
 								newselection.push_back(s);
 							}
 							selection = newselection;

mercurial