1
0
mirror of synced 2025-02-16 10:32:35 +01:00

pattern: Properly display Start/End/Size column again for zero sized types

This commit is contained in:
WerWolv 2023-07-03 21:24:15 +02:00
parent d297b2d1cc
commit ceed8c7420
2 changed files with 4 additions and 8 deletions

@ -1 +1 @@
Subproject commit 965ba40f8b4dca7c1c52a4d7a5b3d42c991f5a96
Subproject commit f8d17fc99949350e9820556b7445014e24c347f1

View File

@ -111,9 +111,7 @@ namespace hex::plugin::builtin::ui {
if (pattern.isPatternLocal()) {
ImGui::TextFormatted("[{}]", "hex.builtin.pattern_drawer.local"_lang);
} else {
if (pattern.getSize() > 0) {
ImGui::TextFormatted("0x{0:08X}", pattern.getOffset());
}
ImGui::TextFormatted("0x{0:08X}", pattern.getOffset());
}
ImGui::TableNextColumn();
@ -121,9 +119,7 @@ namespace hex::plugin::builtin::ui {
if (pattern.isPatternLocal()) {
ImGui::TextFormatted("[{}]", "hex.builtin.pattern_drawer.local"_lang);
} else {
if (pattern.getSize() > 0) {
ImGui::TextFormatted("0x{0:08X}", pattern.getOffset() + pattern.getSize() - (pattern.getSize() == 0 ? 0 : 1));
}
ImGui::TextFormatted("0x{0:08X}", pattern.getOffset() + pattern.getSize() - (pattern.getSize() == 0 ? 0 : 1));
}
ImGui::TableNextColumn();
@ -140,7 +136,7 @@ namespace hex::plugin::builtin::ui {
void drawSizeColumn(const pl::ptrn::Pattern& pattern) {
if (auto *bitfieldMember = dynamic_cast<pl::ptrn::PatternBitfieldMember const*>(&pattern); bitfieldMember != nullptr && bitfieldMember->getParentBitfield() != nullptr)
drawSizeColumnForBitfieldMember(*bitfieldMember);
else if (pattern.getSize() > 0)
else
ImGui::TextFormatted("0x{0:04X}", pattern.getSize());
ImGui::TableNextColumn();