SPE-1920: Fixed crash while moving horizontal slider in preview

This commit is contained in:
enricoturri1966 2023-10-03 09:23:52 +02:00
parent 7341561ec4
commit e26a8982da

View File

@ -544,7 +544,7 @@ void GCodeViewer::SequentialView::GCodeWindow::render(float top, float bottom, s
auto resize_range = [&](Range& range, size_t lines_count) {
const size_t half_lines_count = lines_count / 2;
range.min = (curr_line_id >= half_lines_count) ? curr_line_id - half_lines_count : 1;
range.min = (curr_line_id > half_lines_count) ? curr_line_id - half_lines_count : 1;
range.max = *range.min + lines_count - 1;
size_t lines_ends_count = 0;
for (const auto& le : m_lines_ends) {