Fixed redrawing when alignment is center or right. Extended a comment to a bug which I can't reproduce anymore
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15912 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
fc1e671b53
commit
3d453d2da3
@ -244,15 +244,15 @@ _BStyleBuffer_::SetStyleRange(int32 fromOffset, int32 toOffset,
|
||||
return;
|
||||
}
|
||||
|
||||
int32 styleIndex = 0;
|
||||
int32 offset = fromOffset;
|
||||
int32 runIndex = OffsetToRun(offset);
|
||||
int32 styleIndex = 0;
|
||||
do {
|
||||
STEStyleRunDesc runDesc = *fStyleRunDesc[runIndex];
|
||||
const STEStyleRunDesc runDesc = *fStyleRunDesc[runIndex];
|
||||
int32 runEnd = textLen;
|
||||
if (runIndex < fStyleRunDesc.ItemCount() - 1)
|
||||
runEnd = fStyleRunDesc[runIndex + 1]->offset;
|
||||
|
||||
|
||||
STEStyle style = fStyleRecord[runDesc.index]->style;
|
||||
SetStyle(inMode, inFont, &style.font, inColor, &style.color);
|
||||
|
||||
@ -290,7 +290,8 @@ _BStyleBuffer_::SetStyleRange(int32 fromOffset, int32 toOffset,
|
||||
if (offset == runEnd) {
|
||||
// TODO: this hides a bug somewhere else in the code that
|
||||
// should probably be fixed...
|
||||
printf("offset == runEnd!\n");
|
||||
// Can't reproduce this anymore...
|
||||
printf("_BStyleBuffer_::SetStyleRange(): offset == runEnd!\n");
|
||||
break;
|
||||
}
|
||||
offset = runEnd;
|
||||
|
@ -3242,7 +3242,7 @@ BTextView::Refresh(int32 fromOffset, int32 toOffset, bool erase,
|
||||
|
||||
int32 drawOffset = fromOffset;
|
||||
if (LineHeight(fromLine) != saveLineHeight ||
|
||||
newHeight < saveHeight || fromLine < saveFromLine )
|
||||
newHeight < saveHeight || fromLine < saveFromLine || fAlignment != B_ALIGN_LEFT)
|
||||
drawOffset = (*fLines)[fromLine]->offset;
|
||||
|
||||
// TODO: Is it ok here ?
|
||||
@ -3634,7 +3634,7 @@ BTextView::DrawLines(int32 startLine, int32 endLine, int32 startOffset, bool era
|
||||
BRect eraseRect = clipRect;
|
||||
long startEraseLine = startLine;
|
||||
STELine* line = (*fLines)[startLine];
|
||||
if (erase && startOffset != -1) {
|
||||
if (erase && startOffset != -1 && fAlignment == B_ALIGN_LEFT) {
|
||||
// erase only to the right of startOffset
|
||||
startEraseLine++;
|
||||
long startErase = startOffset;
|
||||
|
Loading…
Reference in New Issue
Block a user