fixed choppy text rendering when dragging the scrollbar with mouse (credit goes to WerWolv) and top margin adjustment when find/replace popup window first appears if it is blocking the entry under the cursor.

This commit is contained in:
paxcut
2026-03-20 04:40:08 -07:00
committed by paxcut
parent f70268ea40
commit c677aae7b1

View File

@@ -1146,10 +1146,6 @@ namespace hex::ui {
m_scroll = ImVec2(scrollX, scrollY);
}
if (m_lines.m_setTopRow)
m_lines.setFirstRow();
else
m_lines.m_topRow = std::max<float>(0.0F, (scrollY - m_lines.m_topMargin) / m_lines.m_charAdvance.y);
m_topLineNumber = getTopLineNumber();
float maxDisplayedRow = m_lines.getMaxDisplayedRow();
float lineIndex = m_topLineNumber;
@@ -1207,6 +1203,10 @@ namespace hex::ui {
row = row + 1.0F;
}
if (m_lines.m_setTopRow)
m_lines.setFirstRow();
else
m_lines.m_topRow = std::max<float>(0.0F, (scrollY - m_lines.m_topMargin) / m_lines.m_charAdvance.y);
} else {
m_lines.m_rowToLineIndex[0] = 1;
m_topLineNumber = 1;
@@ -1662,6 +1662,8 @@ namespace hex::ui {
m_shiftedScrollY = oldScrollY - pixelCount;
ImGui::SetScrollY(m_shiftedScrollY);
m_lines.m_topMargin = m_newTopMargin;
m_lines.ensureCursorVisible();
}
}
}