fix: Moving cursor around using arrow keys behaving weirdly

This commit is contained in:
WerWolv
2023-03-17 09:17:44 +01:00
parent 5442c32a3f
commit 64be6d89ee
3 changed files with 72 additions and 15 deletions

View File

@@ -51,8 +51,8 @@ namespace hex::prv {
offset = region.getEndAddress() + 1;
auto [newRegion, newValid] = this->getRegionValidity(offset + this->getBaseAddress());
bufferSize = std::min(bufferSize, (newRegion.getEndAddress() - offset) + 1);
bufferSize = std::min(bufferSize, this->getActualSize() - offset);
bufferSize = std::min<size_t>(bufferSize, (newRegion.getEndAddress() - offset) + 1);
bufferSize = std::min<size_t>(bufferSize, this->getActualSize() - offset);
this->read(offset + this->getBaseAddress(), buffer.data(), bufferSize, true);
file.write(buffer.data(), bufferSize);