1
0
mirror of synced 2024-11-12 10:10:53 +01:00

fix: Crash when loading custom encodings

This commit is contained in:
WerWolv 2023-06-05 16:56:50 +02:00
parent c690f7627f
commit b8457439a4

View File

@ -555,9 +555,11 @@ namespace hex::plugin::builtin::ui {
this->drawSelectionFrame(x, y, address, 1, cellStartPos, cellSize);
}
auto startPos = ImGui::GetCursorPosX();
auto startPos = ImGui::GetCursorPos();
ImGui::TextFormattedColored(data.color, "{}", data.displayValue);
ImGui::SetCursorPosX(startPos + cellSize.x);
ImGui::SetCursorPosX(startPos.x + cellSize.x);
ImGui::SameLine(0, 0);
ImGui::Dummy({ 0, 0 });
this->handleSelection(address, data.advance, &bytes[address % this->m_bytesPerRow], cellHovered);
}
@ -787,9 +789,11 @@ namespace hex::plugin::builtin::ui {
pushed = true;
}
ImGui::BeginDisabled(!this->m_currCustomEncoding.has_value());
if (ImGui::DimmedIconButton(ICON_VS_WHITESPACE, ImGui::GetStyleColorVec4(ImGuiCol_Text))) {
this->m_showCustomEncoding = !this->m_showCustomEncoding;
}
ImGui::EndDisabled();
if (pushed)
ImGui::PopStyleColor();