Improve memory map reselection after sorting

This commit is contained in:
Duncan Ogilvie 2024-08-24 19:57:51 +02:00
parent 5e9425045d
commit f361ef3f82
2 changed files with 3 additions and 3 deletions

View File

@ -205,7 +205,7 @@ void MemoryMapView::selectionChangedSlot(duint index)
mSelectionStart = getCellUserdata(mSelection.firstSelectedIndex, ColAddress);
mSelectionEnd = mSelectionStart + getCellUserdata(mSelection.firstSelectedIndex, ColSize);
mSelectionCount = mSelection.toIndex - mSelection.fromIndex;
mSelectionSort = mSort.column;
mSelectionSort = mSort;
}
void MemoryMapView::fixSelectionRangeSlot()
@ -219,7 +219,7 @@ void MemoryMapView::fixSelectionRangeSlot()
// Restore the selection
mSelection.firstSelectedIndex = row;
mSelection.fromIndex = mSelection.toIndex = row;
if(mSelectionSort == mSort.column)
if(mSelectionSort.column == mSort.column && mSelectionSort.ascending == mSort.ascending)
{
mSelection.toIndex += mSelectionCount;
updateViewport();

View File

@ -111,5 +111,5 @@ private:
duint mSelectionStart = 0;
duint mSelectionEnd = 0;
duint mSelectionCount = 0;
duint mSelectionSort = -1;
SortData mSelectionSort;
};