1
0
mirror of synced 2024-11-12 02:00:52 +01:00

Fixed empty struct and union offset display

This commit is contained in:
WerWolv 2021-01-10 19:43:21 +01:00
parent dc6c1fa622
commit b4ef19dac7

View File

@ -526,7 +526,7 @@ namespace hex::lang {
bool open = ImGui::TreeNodeEx(this->getVariableName().c_str(), ImGuiTreeNodeFlags_SpanFullWidth);
ImGui::TableNextColumn();
ImGui::TableNextColumn();
ImGui::Text("0x%08llx : 0x%08llx", this->getOffset(), this->getOffset() + this->getSize() - 1);
ImGui::Text("0x%08llx : 0x%08llx", this->getOffset(), this->getOffset() + this->getSize() - (this->getSize() == 0 ? 0 : 1));
ImGui::TableNextColumn();
ImGui::Text("0x%04llx", this->getSize());
ImGui::TableNextColumn();
@ -606,7 +606,7 @@ namespace hex::lang {
bool open = ImGui::TreeNodeEx(this->getVariableName().c_str(), ImGuiTreeNodeFlags_SpanFullWidth);
ImGui::TableNextColumn();
ImGui::TableNextColumn();
ImGui::Text("0x%08llx : 0x%08llx", this->getOffset(), this->getOffset() + this->getSize() - 1);
ImGui::Text("0x%08llx : 0x%08llx", this->getOffset(), std::max(this->getOffset() + this->getSize() - (this->getSize() == 0 ? 0 : 1), u64(0)));
ImGui::TableNextColumn();
ImGui::Text("0x%04llx", this->getSize());
ImGui::TableNextColumn();