From 2e4eaf8d3391b50a62de6c599c03aada01fd6d5c Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 2 Mar 2021 13:49:23 +0100 Subject: [PATCH] ux: Fixed region selection only selecting one byte --- external/ImGui/include/imgui_memory_editor.h | 3 ++- source/views/view_hexeditor.cpp | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/external/ImGui/include/imgui_memory_editor.h b/external/ImGui/include/imgui_memory_editor.h index 17ea5653f..252c3aa55 100644 --- a/external/ImGui/include/imgui_memory_editor.h +++ b/external/ImGui/include/imgui_memory_editor.h @@ -715,7 +715,8 @@ struct MemoryEditor ImGui::BeginChild("##scrolling"); ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + (GotoAddr / Cols) * ImGui::GetTextLineHeight()); ImGui::EndChild(); - DataEditingAddr = DataPreviewAddr = DataPreviewAddrEnd = GotoAddr; + DataEditingAddr = DataPreviewAddr = HighlightMin; + DataPreviewAddrEnd = HighlightMax; DataEditingTakeFocus = true; } GotoAddr = (size_t)-1; diff --git a/source/views/view_hexeditor.cpp b/source/views/view_hexeditor.cpp index 742ede4a9..66d3519f1 100644 --- a/source/views/view_hexeditor.cpp +++ b/source/views/view_hexeditor.cpp @@ -146,9 +146,7 @@ namespace hex { return; provider->setCurrentPage(page.value()); - this->m_memoryEditor.GotoAddr = region.address; - this->m_memoryEditor.DataPreviewAddr = region.address; - this->m_memoryEditor.DataPreviewAddrEnd = region.address + region.size - 1; + this->m_memoryEditor.GotoAddrAndHighlight(region.address, region.address + region.size - 1); View::postEvent(Events::RegionSelected, region); });