1
0
mirror of synced 2025-02-17 18:59:21 +01:00

fix: Selection changes not being handled correctly

This commit is contained in:
WerWolv 2023-07-21 14:22:53 +02:00
parent 0033d9f4eb
commit ee41a5a046

View File

@ -58,6 +58,8 @@ namespace hex::plugin::builtin::ui {
return value & ~(alignment - 1);
};
this->m_selectionChanged = this->m_selectionStart != start || this->m_selectionEnd != end;
if (!this->m_selectionStart.has_value()) this->m_selectionStart = start;
if (!this->m_selectionEnd.has_value()) this->m_selectionEnd = end;
@ -75,7 +77,6 @@ namespace hex::plugin::builtin::ui {
this->m_selectionEnd = std::clamp<u128>(end, 0, maxAddress);
this->m_cursorPosition = this->m_selectionEnd;
this->m_selectionChanged = this->m_selectionStart != start || this->m_selectionEnd != end;
if (this->m_selectionChanged) {
auto selection = this->getSelection();
EventManager::post<EventRegionSelected>(ImHexApi::HexEditor::ProviderRegion{ { selection.address, selection.size }, this->m_provider });