1
0
mirror of synced 2024-11-29 01:44:31 +01:00

fix: Properly clear valid region when switching to a different provider

This commit is contained in:
WerWolv 2023-03-21 16:11:40 +01:00
parent be16b66ac0
commit f3f0dda3d4
2 changed files with 5 additions and 2 deletions

View File

@ -25,7 +25,10 @@ namespace hex::plugin::builtin::ui {
~HexEditor();
void draw(float height = ImGui::GetContentRegionAvail().y);
void setProvider(prv::Provider *provider) { this->m_provider = provider; }
void setProvider(prv::Provider *provider) {
this->m_provider = provider;
this->m_currValidRegion = { Region::Invalid(), false };
}
void setUnknownDataCharacter(char character) { this->m_unknownDataCharacter = character; }
private:
enum class CellType { None, Hex, ASCII };

View File

@ -358,7 +358,7 @@ namespace hex::plugin::builtin::ui {
ImGui::TableNextColumn();
if (this->m_provider != nullptr && this->m_provider->isReadable()) {
const auto isCurrRegionValid = [this](u64 address){
const auto isCurrRegionValid = [this](u64 address) {
auto &[currRegion, currRegionValid] = this->m_currValidRegion;
if (!Region{ address, 1 }.isWithin(currRegion)) {
this->m_currValidRegion = this->m_provider->getRegionValidity(address);