impr: Jump to top of selection instead of the bottom

Fixes #2354
This commit is contained in:
WerWolv
2025-09-10 20:50:27 +02:00
parent 88ccb0e075
commit c1619820c7
2 changed files with 7 additions and 4 deletions

View File

@@ -55,6 +55,9 @@ namespace hex::ui {
}
ScrollPosition& operator=(ImS64 value) {
if (value < 0)
value = 0;
this->get() = value;
return *this;
}
@@ -157,7 +160,7 @@ namespace hex::ui {
m_selectionStart = std::clamp<u64>(start, 0, maxAddress);
m_selectionEnd = std::clamp<u64>(end, 0, maxAddress);
m_cursorPosition = m_selectionEnd;
m_cursorPosition = m_selectionStart;
if (m_selectionChanged) {
auto selection = this->getSelection();