fix: misuse of clipper (#445)
clipper.Step() should be called in a loop until it returns false. You don't need to call End() after it. Co-authored-by: Dmitry Polshakov <dmitry.polshakov@dsr-corporation.com>
This commit is contained in:
parent
39cc845df3
commit
07ae00aa20
@ -295,7 +295,6 @@ struct MemoryEditor
|
||||
|
||||
const int line_total_count = (int)((mem_size + Cols - 1) / Cols);
|
||||
clipper.Begin(line_total_count, s.LineHeight);
|
||||
clipper.Step();
|
||||
const size_t visible_start_addr = clipper.DisplayStart * Cols;
|
||||
const size_t visible_end_addr = clipper.DisplayEnd * Cols;
|
||||
const size_t visible_count = visible_end_addr - visible_start_addr;
|
||||
@ -377,6 +376,8 @@ struct MemoryEditor
|
||||
const char* format_byte_space = OptUpperCaseHex ? "%02X " : "%02x ";
|
||||
|
||||
bool tooltipShown = false;
|
||||
while (clipper.Step())
|
||||
{
|
||||
for (int line_i = clipper.DisplayStart; line_i < clipper.DisplayEnd; line_i++) // display only visible lines
|
||||
{
|
||||
size_t addr = (size_t)(line_i * Cols);
|
||||
@ -688,8 +689,8 @@ struct MemoryEditor
|
||||
}
|
||||
}
|
||||
}
|
||||
clipper.Step();
|
||||
clipper.End();
|
||||
}
|
||||
|
||||
ImGui::PopStyleVar(2);
|
||||
ImGui::EndChild();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user