I noticed that when viewing files, the "view lines" shown on the overview did not line up with the actual lines that were being viewed. Instead, one of the lines would always remain near the top of the file.
This is because this change added some extra brackets to Overview::getViewLines() that changed the order of operations in the calculation of bottom. I've fixed up the order of operations for this calculation.
Original working code:
bottom = (int)((qint64)top + nbLines_.get() * height_ / linesInFile_.get());
Code with incorrect order of operations:
bottom = static_cast<int>( ( static_cast<unsigned>( top ) + nbLines_.get() ) * height_ / ( linesInFile_.get() ) );
I noticed that when viewing files, the "view lines" shown on the overview did not line up with the actual lines that were being viewed. Instead, one of the lines would always remain near the top of the file.
This is because this change added some extra brackets to
Overview::getViewLines()
that changed the order of operations in the calculation ofbottom
. I've fixed up the order of operations for this calculation.Original working code:
bottom = (int)((qint64)top + nbLines_.get() * height_ / linesInFile_.get());
Code with incorrect order of operations:
bottom = static_cast<int>( ( static_cast<unsigned>( top ) + nbLines_.get() ) * height_ / ( linesInFile_.get() ) );
Fixed code:
bottom = top + static_cast<int>( nbLines_.get() * height_ / ( linesInFile_.get() ) );