1
0
mirror of synced 2024-11-15 03:27:40 +01:00

fix: Crash when exiting hex editor editing mode

Fixes #658
This commit is contained in:
WerWolv 2022-08-06 17:47:11 +02:00
parent 31fcf86008
commit 4f37345324

View File

@ -533,11 +533,6 @@ namespace hex::plugin::builtin {
ImGui::SetKeyboardFocusHere();
ImGui::SetNextFrameWantCaptureKeyboard(true);
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) {
this->m_editingAddress = std::nullopt;
this->m_shouldModifyValue = false;
}
if (this->m_currDataVisualizer->drawEditing(*this->m_editingAddress, this->m_editingBytes.data(), this->m_editingBytes.size(), this->m_upperCaseHex, this->m_enteredEditingMode) || this->m_shouldModifyValue) {
provider->write(*this->m_editingAddress, this->m_editingBytes.data(), this->m_editingBytes.size());
@ -558,6 +553,11 @@ namespace hex::plugin::builtin {
this->m_shouldUpdateEditingValue = true;
}
if (ImGui::IsMouseClicked(ImGuiMouseButton_Left) && !hovered) {
this->m_editingAddress = std::nullopt;
this->m_shouldModifyValue = false;
}
this->m_enteredEditingMode = false;
}
}