1
0
mirror of synced 2025-01-11 05:42:15 +01:00

impr: Allow highlights of multiple overlapping bookmarks to render

This commit is contained in:
WerWolv 2025-01-04 20:46:39 +01:00
parent e68abefe48
commit c56af08c7e

View File

@ -63,12 +63,17 @@ namespace hex::plugin::builtin {
std::ignore = data; std::ignore = data;
// Check all bookmarks for potential overlaps with the current address // Check all bookmarks for potential overlaps with the current address
std::optional<ImColor> color;
for (const auto &bookmark : *m_bookmarks) { for (const auto &bookmark : *m_bookmarks) {
if (Region { address, size }.isWithin(bookmark.entry.region)) if (Region { address, size }.isWithin(bookmark.entry.region)) {
return bookmark.entry.color; if (color.has_value())
color = ImAlphaBlendColors(*color, bookmark.entry.color);
else
color = bookmark.entry.color;
}
} }
return std::nullopt; return color;
}); });
// Draw hex editor tooltips for bookmarks // Draw hex editor tooltips for bookmarks