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:
@@ -244,15 +244,15 @@ _BStyleBuffer_::SetStyleRange(int32 fromOffset, int32 toOffset,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 styleIndex = 0;
|
|
||||||
int32 offset = fromOffset;
|
int32 offset = fromOffset;
|
||||||
int32 runIndex = OffsetToRun(offset);
|
int32 runIndex = OffsetToRun(offset);
|
||||||
|
int32 styleIndex = 0;
|
||||||
do {
|
do {
|
||||||
STEStyleRunDesc runDesc = *fStyleRunDesc[runIndex];
|
const STEStyleRunDesc runDesc = *fStyleRunDesc[runIndex];
|
||||||
int32 runEnd = textLen;
|
int32 runEnd = textLen;
|
||||||
if (runIndex < fStyleRunDesc.ItemCount() - 1)
|
if (runIndex < fStyleRunDesc.ItemCount() - 1)
|
||||||
runEnd = fStyleRunDesc[runIndex + 1]->offset;
|
runEnd = fStyleRunDesc[runIndex + 1]->offset;
|
||||||
|
|
||||||
STEStyle style = fStyleRecord[runDesc.index]->style;
|
STEStyle style = fStyleRecord[runDesc.index]->style;
|
||||||
SetStyle(inMode, inFont, &style.font, inColor, &style.color);
|
SetStyle(inMode, inFont, &style.font, inColor, &style.color);
|
||||||
|
|
||||||
@@ -290,7 +290,8 @@ _BStyleBuffer_::SetStyleRange(int32 fromOffset, int32 toOffset,
|
|||||||
if (offset == runEnd) {
|
if (offset == runEnd) {
|
||||||
// TODO: this hides a bug somewhere else in the code that
|
// TODO: this hides a bug somewhere else in the code that
|
||||||
// should probably be fixed...
|
// should probably be fixed...
|
||||||
printf("offset == runEnd!\n");
|
// Can't reproduce this anymore...
|
||||||
|
printf("_BStyleBuffer_::SetStyleRange(): offset == runEnd!\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
offset = runEnd;
|
offset = runEnd;
|
||||||
|
|||||||
@@ -3242,7 +3242,7 @@ BTextView::Refresh(int32 fromOffset, int32 toOffset, bool erase,
|
|||||||
|
|
||||||
int32 drawOffset = fromOffset;
|
int32 drawOffset = fromOffset;
|
||||||
if (LineHeight(fromLine) != saveLineHeight ||
|
if (LineHeight(fromLine) != saveLineHeight ||
|
||||||
newHeight < saveHeight || fromLine < saveFromLine )
|
newHeight < saveHeight || fromLine < saveFromLine || fAlignment != B_ALIGN_LEFT)
|
||||||
drawOffset = (*fLines)[fromLine]->offset;
|
drawOffset = (*fLines)[fromLine]->offset;
|
||||||
|
|
||||||
// TODO: Is it ok here ?
|
// TODO: Is it ok here ?
|
||||||
@@ -3634,7 +3634,7 @@ BTextView::DrawLines(int32 startLine, int32 endLine, int32 startOffset, bool era
|
|||||||
BRect eraseRect = clipRect;
|
BRect eraseRect = clipRect;
|
||||||
long startEraseLine = startLine;
|
long startEraseLine = startLine;
|
||||||
STELine* line = (*fLines)[startLine];
|
STELine* line = (*fLines)[startLine];
|
||||||
if (erase && startOffset != -1) {
|
if (erase && startOffset != -1 && fAlignment == B_ALIGN_LEFT) {
|
||||||
// erase only to the right of startOffset
|
// erase only to the right of startOffset
|
||||||
startEraseLine++;
|
startEraseLine++;
|
||||||
long startErase = startOffset;
|
long startErase = startOffset;
|
||||||
|
|||||||
Reference in New Issue
Block a user