fix: Wrong end address for bitfield fields in pattern data view

This commit is contained in:
WerWolv
2024-07-02 17:38:53 +02:00
parent 313e3e748f
commit b3b7a19df4

View File

@@ -111,7 +111,9 @@ namespace hex::ui {
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("0x{0:08X}.{1}", pattern.getOffset(), pattern.getBitOffsetForDisplay());
ImGui::TableNextColumn();
ImGuiExt::TextFormatted("0x{0:08X}.{1}", pattern.getOffset() + pattern.getSize(), (pattern.getBitOffsetForDisplay() + pattern.getBitSize() - (pattern.getSize() == 0 ? 0 : 1)) % 8);
const auto bitSize = (pattern.getBitOffsetForDisplay() + pattern.getBitSize() - (pattern.getSize() == 0 ? 0 : 1));
ImGuiExt::TextFormatted("0x{0:08X}.{1}", pattern.getOffset() + bitSize / 8, bitSize % 8);
}
}