mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-28 07:47:03 -05:00
fix: Gaps in-between hex editor highlighting on specific scalings
(cherry picked from commit 62732de227)
This commit is contained in:
@@ -782,6 +782,7 @@ namespace hex::ui {
|
||||
auto byteCellSize = (CharacterSize * ImVec2(maxCharsPerCell, 1)) + (ImVec2(2, 2) * ImGui::GetStyle().CellPadding) + scaled(ImVec2(1 + m_byteCellPadding, 0));
|
||||
byteCellSize = ImVec2(std::ceil(byteCellSize.x), std::ceil(byteCellSize.y));
|
||||
|
||||
std::optional<float> prevEndPosX;
|
||||
for (u64 x = 0; x < columnCount; x++) {
|
||||
const u64 byteAddress = y * bytesPerRow + x * bytesPerCell + m_provider->getBaseAddress() + m_provider->getCurrentPageAddress();
|
||||
|
||||
@@ -794,6 +795,7 @@ namespace hex::ui {
|
||||
|
||||
if (x < std::ceil(float(validBytes) / bytesPerCell)) {
|
||||
auto cellStartPos = getCellPosition();
|
||||
|
||||
auto [foregroundColor, backgroundColor] = cellColors[x];
|
||||
|
||||
auto adjustedCellSize = byteCellSize;
|
||||
@@ -809,6 +811,13 @@ namespace hex::ui {
|
||||
|
||||
backgroundColor = applySelectionColor(byteAddress, backgroundColor);
|
||||
|
||||
if (prevEndPosX.has_value()) {
|
||||
adjustedCellSize.x += cellStartPos.x - prevEndPosX.value();
|
||||
cellStartPos.x = prevEndPosX.value();
|
||||
}
|
||||
|
||||
prevEndPosX = cellStartPos.x + adjustedCellSize.x;
|
||||
|
||||
// Draw highlights and selection
|
||||
if (backgroundColor.has_value()) {
|
||||
this->drawBackgroundHighlight(cellStartPos, adjustedCellSize, backgroundColor.value());
|
||||
|
||||
Reference in New Issue
Block a user