1
0
mirror of synced 2025-01-18 00:56:49 +01:00

fix: Multi-byte hex editor data visualizers behaving incorrectly

This commit is contained in:
WerWolv 2023-11-13 09:28:57 +01:00
parent 27f420c8ea
commit 1f73a87327
2 changed files with 6 additions and 3 deletions

View File

@ -162,7 +162,7 @@ namespace hex::plugin::builtin {
hex::unused(address, upperCase, startedEditing);
if (size == ByteCount) {
return drawDefaultScalarEditingTextBox(address, getFormatString(upperCase), ImGui::getImGuiDataType<u8>(), data, ImGuiInputTextFlags_CharsScientific);
return drawDefaultScalarEditingTextBox(address, getFormatString(upperCase), ImGui::getImGuiDataType<T>(), data, ImGuiInputTextFlags_CharsScientific);
}
else
return false;

View File

@ -162,8 +162,11 @@ namespace hex::plugin::builtin::ui {
if (this->m_shouldUpdateEditingValue && address == this->m_editingAddress) {
this->m_shouldUpdateEditingValue = false;
this->m_editingBytes.resize(size);
std::memcpy(this->m_editingBytes.data(), data, size);
if (this->m_editingBytes.size() < size) {
this->m_editingBytes.resize(size);
std::memcpy(this->m_editingBytes.data(), data, size);
}
}
if (this->m_editingAddress != address || this->m_editingCellType != cellType) {