From d601f6e882f8e3cd41590c31ad5ac66c1c9e1373 Mon Sep 17 00:00:00 2001 From: shatty Date: Thu, 11 Nov 2004 10:07:40 +0000 Subject: [PATCH] rename RecalLineBreaks to RecalculateLineBreaks ; use ceil() when computing the origins for lines git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9913 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/TextView.h | 2 +- src/kits/interface/BTextView/TextView.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/headers/os/interface/TextView.h b/headers/os/interface/TextView.h index 96d404d87a..a49e1f33c2 100644 --- a/headers/os/interface/TextView.h +++ b/headers/os/interface/TextView.h @@ -299,7 +299,7 @@ virtual void _ReservedTextView12(); int32 toOffset, bool erase, bool scroll); - void RecalLineBreaks(int32 *startLine, int32 *endLine); + void RecalculateLineBreaks(int32 *startLine, int32 *endLine); int32 FindLineBreak(int32 fromOffset, float *outAscent, float *outDescent, diff --git a/src/kits/interface/BTextView/TextView.cpp b/src/kits/interface/BTextView/TextView.cpp index dc63efbc96..5cab8568d4 100644 --- a/src/kits/interface/BTextView/TextView.cpp +++ b/src/kits/interface/BTextView/TextView.cpp @@ -3278,7 +3278,7 @@ BTextView::Refresh(int32 fromOffset, int32 toOffset, bool erase, float saveLineHeight = LineHeight(fromLine); BRect bounds = Bounds(); - RecalLineBreaks(&fromLine, &toLine); + RecalculateLineBreaks(&fromLine, &toLine); float newHeight = fTextRect.Height(); @@ -3333,7 +3333,7 @@ BTextView::Refresh(int32 fromOffset, int32 toOffset, bool erase, void -BTextView::RecalLineBreaks(int32 *startLine, int32 *endLine) +BTextView::RecalculateLineBreaks(int32 *startLine, int32 *endLine) { CALLED(); // are we insane? @@ -3368,13 +3368,13 @@ BTextView::RecalLineBreaks(int32 *startLine, int32 *endLine) // the new line comes before the old line start, add a line STELine newLine; newLine.offset = toOffset; - newLine.origin = curLine->origin + ascent + descent; + newLine.origin = ceil(curLine->origin + ascent + descent); newLine.ascent = 0; fLines->InsertLine(&newLine, lineIndex); } else { // update the exising line nextLine->offset = toOffset; - nextLine->origin = curLine->origin + ascent + descent; + nextLine->origin = ceil(curLine->origin + ascent + descent); // remove any lines that start before the current line while ( lineIndex < fLines->NumLines() &&