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
This commit is contained in:
shatty
2004-11-11 10:07:40 +00:00
parent 83bf0add93
commit d601f6e882
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -299,7 +299,7 @@ virtual void _ReservedTextView12();
int32 toOffset, int32 toOffset,
bool erase, bool erase,
bool scroll); bool scroll);
void RecalLineBreaks(int32 *startLine, int32 *endLine); void RecalculateLineBreaks(int32 *startLine, int32 *endLine);
int32 FindLineBreak(int32 fromOffset, int32 FindLineBreak(int32 fromOffset,
float *outAscent, float *outAscent,
float *outDescent, float *outDescent,
+4 -4
View File
@@ -3278,7 +3278,7 @@ BTextView::Refresh(int32 fromOffset, int32 toOffset, bool erase,
float saveLineHeight = LineHeight(fromLine); float saveLineHeight = LineHeight(fromLine);
BRect bounds = Bounds(); BRect bounds = Bounds();
RecalLineBreaks(&fromLine, &toLine); RecalculateLineBreaks(&fromLine, &toLine);
float newHeight = fTextRect.Height(); float newHeight = fTextRect.Height();
@@ -3333,7 +3333,7 @@ BTextView::Refresh(int32 fromOffset, int32 toOffset, bool erase,
void void
BTextView::RecalLineBreaks(int32 *startLine, int32 *endLine) BTextView::RecalculateLineBreaks(int32 *startLine, int32 *endLine)
{ {
CALLED(); CALLED();
// are we insane? // 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 // the new line comes before the old line start, add a line
STELine newLine; STELine newLine;
newLine.offset = toOffset; newLine.offset = toOffset;
newLine.origin = curLine->origin + ascent + descent; newLine.origin = ceil(curLine->origin + ascent + descent);
newLine.ascent = 0; newLine.ascent = 0;
fLines->InsertLine(&newLine, lineIndex); fLines->InsertLine(&newLine, lineIndex);
} else { } else {
// update the exising line // update the exising line
nextLine->offset = toOffset; 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 // remove any lines that start before the current line
while ( lineIndex < fLines->NumLines() && while ( lineIndex < fLines->NumLines() &&