Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9872925b authored by Kurt Hindenburg's avatar Kurt Hindenburg

separate 'if' to return earlier

parent c442d223
......@@ -1005,6 +1005,11 @@ uint TerminalDisplay::randomSeed() const
// Instead only new lines have to be drawn
void TerminalDisplay::scrollImage(int lines , const QRect& screenWindowRegion)
{
// return if there is nothing to do
if ((lines == 0) || (_image == nullptr)) {
return;
}
// if the flow control warning is enabled this will interfere with the
// scrolling optimizations and cause artifacts. the simple solution here
// is to just disable the optimization whilst it is visible
......@@ -1024,9 +1029,7 @@ void TerminalDisplay::scrollImage(int lines , const QRect& screenWindowRegion)
region.setBottom(qMin(region.bottom(), this->_lines - 2));
// return if there is nothing to do
if (lines == 0
|| _image == nullptr
|| !region.isValid()
if (!region.isValid()
|| (region.top() + abs(lines)) >= region.bottom()
|| this->_lines <= region.height()) {
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment