fix: Byte editing mode not exiting when clicking somewhere else

Fixes #607
This commit is contained in:
WerWolv 2022-07-30 23:01:25 +02:00
parent 45ea22083e
commit 1ed88f3910
1 changed files with 5 additions and 0 deletions

View File

@ -533,6 +533,11 @@ namespace hex::plugin::builtin {
ImGui::SetKeyboardFocusHere();
ImGui::CaptureKeyboardFromApp(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());