1
0
mirror of synced 2024-11-13 18:50:53 +01:00

fix: Advancing to next row when editing bytes loading wrong value

Fixes #973
This commit is contained in:
WerWolv 2023-03-14 10:24:25 +01:00
parent 3a840c4ced
commit ec2934b4b8

View File

@ -262,11 +262,13 @@ namespace hex::plugin::builtin::ui {
void HexEditor::drawCell(u64 address, u8 *data, size_t size, bool hovered, CellType cellType) {
static DataVisualizerAscii asciiVisualizer;
if (this->m_shouldUpdateEditingValue) {
this->m_shouldUpdateEditingValue = false;
if (this->m_shouldUpdateEditingValue && this->m_editingAddress.has_value()) {
if (!((this->m_editingAddress.value() % this->m_bytesPerRow) == 0 && address != this->m_editingAddress.value())) {
this->m_shouldUpdateEditingValue = false;
this->m_editingBytes.resize(size);
std::memcpy(this->m_editingBytes.data(), data, size);
this->m_editingBytes.resize(size);
std::memcpy(this->m_editingBytes.data(), data, size);
}
}
if (this->m_editingAddress != address || this->m_editingCellType != cellType) {