From 9b46a2b25d3026bd60dd4011ee6244b7e591a9e5 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 29 Aug 2010 10:43:54 +0000 Subject: [PATCH] Fix more drawing problems in terminal, and remove an useless variable. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38424 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/terminal/TermView.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 46ec069529..34fc88c1a2 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -1354,10 +1354,8 @@ TermView::Draw(BRect updateRect) if (k < 0) k = 0; - int32 terminalEnd = (int)updateRect.right / fFontWidth; - // physical limit of the terminal - for (int32 i = k; i < terminalEnd;) { - int32 lastColumn = terminalEnd; + for (int32 i = k; i <= x2;) { + int32 lastColumn = x2; bool insideSelection = _CheckSelectedRegion(j, i, lastColumn); // This will clip lastColumn to the selection start or end // to ensure the selection is not drawn at the same time as @@ -1384,7 +1382,7 @@ TermView::Draw(BRect updateRect) // guess the color for this line from the last char // that was drawn in it. int t = 1; - while (count == 0 && i - t > 0) { + while (count == 0 && i - t >= 0) { count = fVisibleTextBuffer->GetString( j - firstVisible, i - t, lastColumn, buf, attr);