1
0
mirror of synced 2025-01-30 03:27:25 +01:00

impr: Allow hex editor view to be scrolled slightly past the end

This commit is contained in:
WerWolv 2023-07-18 14:22:39 +02:00
parent 7fc53bf861
commit 90267ec356

View File

@ -334,12 +334,13 @@ namespace hex::plugin::builtin::ui {
ImGuiListClipper clipper;
clipper.Begin(std::ceil(this->m_provider->getSize() / (long double)(this->m_bytesPerRow)), CharacterSize.y);
u64 numRows = std::ceil(this->m_provider->getSize() / (long double)(this->m_bytesPerRow));
clipper.Begin(numRows + size.y / CharacterSize.y - 3, CharacterSize.y);
while (clipper.Step()) {
this->m_visibleRowCount = clipper.DisplayEnd - clipper.DisplayStart;
// Loop over rows
for (u64 y = u64(clipper.DisplayStart); y < u64(clipper.DisplayEnd); y++) {
for (u64 y = u64(clipper.DisplayStart); y < std::min(numRows, u64(clipper.DisplayEnd)); y++) {
// Draw address column
ImGui::TableNextRow();
ImGui::TableNextColumn();