1
0
mirror of synced 2024-11-24 15:50:16 +01:00

ui: Fixed rendering of advanced decoding highlighting with multi-byte visualizers

This commit is contained in:
WerWolv 2022-07-25 23:46:32 +02:00
parent c776bb6c03
commit cf017540e2

View File

@ -847,13 +847,13 @@ namespace hex::plugin::builtin {
ImGui::TableNextColumn();
const auto cellStartPos = getCellPosition();
const auto cellSize = CharacterSize * ImVec2(std::max<float>(1, data.displayValue.length()), 1);
const auto cellSize = ImGui::CalcTextSize(data.displayValue.c_str()) * ImVec2(1, 0) + ImVec2(0, CharacterSize.y);
const bool cellHovered = ImGui::IsMouseHoveringRect(cellStartPos, cellStartPos + cellSize, true);
const auto x = address % this->m_bytesPerRow;
if (x < validBytes) {
auto [foregroundColor, backgroundColor] = cellColors[x];
auto [foregroundColor, backgroundColor] = cellColors[x / bytesPerCell];
// Draw highlights and selection
if (backgroundColor.has_value()) {