Author: phoudoin Date: 2010-09-22 11:44:21 +0200 (Wed, 22 Sep 2010) New Revision: 38783 Changeset: http://dev.haiku-os.org/changeset/38783 Ticket: http://dev.haiku-os.org/ticket/1 Ticket: http://dev.haiku-os.org/ticket/6530 Modified: haiku/trunk/src/apps/terminal/TermView.cpp Log: Fix visual artifact !#1 described in #6530. Modified: haiku/trunk/src/apps/terminal/TermView.cpp =================================================================== --- haiku/trunk/src/apps/terminal/TermView.cpp 2010-09-22 08:21:42 UTC (rev 38782) +++ haiku/trunk/src/apps/terminal/TermView.cpp 2010-09-22 09:44:21 UTC (rev 38783) @@ -1171,7 +1171,7 @@ int32 firstVisible = _LineAt(0); UTF8Char character; - uint32 attr; + uint32 attr = 0; bool cursorVisible = _IsCursorVisible(); @@ -1340,6 +1340,28 @@ int32 y1 = _LineAt(updateRect.top); int32 y2 = std::min(_LineAt(updateRect.bottom), (int32)fRows - 1); + // clear the area to the right of the line ends + if (y1 <= y2) { + float clearLeft = fColumns * fFontWidth; + if (clearLeft <= updateRect.right) { + BRect rect(clearLeft, updateRect.top, updateRect.right, + updateRect.bottom); + SetHighColor(kTermColorTable[0]); + FillRect(rect); + } + } + + // clear the area below the last line + if (y2 == fRows - 1) { + float clearTop = _LineOffset(fRows); + if (clearTop <= updateRect.bottom) { + BRect rect(updateRect.left, clearTop, updateRect.right, + updateRect.bottom); + SetHighColor(kTermColorTable[0]); + FillRect(rect); + } + } + // draw the affected line parts if (x1 <= x2) { uint32 attr = 0; @@ -1412,15 +1434,6 @@ i += count; } } - - if (y2 == fRows - 1) { - // There may be some empty space below the last line - BRect rect(updateRect.left, _LineOffset(fRows), - updateRect.right, 0); - rect.bottom = rect.top + fFontHeight - 1; - FillRect(rect); - } - } if (fInline && fInline->IsActive())