Simplified a bit a part of FindLineBreak. Removed a now useless comment
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18361 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -779,7 +779,6 @@ void
|
|||||||
BTextView::Pulse()
|
BTextView::Pulse()
|
||||||
{
|
{
|
||||||
if (fActive && fEditable && fSelStart == fSelEnd) {
|
if (fActive && fEditable && fSelStart == fSelEnd) {
|
||||||
// TODO: Is this check needed ?
|
|
||||||
if (system_time() > (fCaretTime + 500000.0))
|
if (system_time() > (fCaretTime + 500000.0))
|
||||||
InvertCaret();
|
InvertCaret();
|
||||||
}
|
}
|
||||||
@@ -3298,37 +3297,29 @@ BTextView::FindLineBreak(int32 fromOffset, float *outAscent, float *outDescent,
|
|||||||
return limit;
|
return limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool done = false;
|
|
||||||
float ascent = 0.0;
|
|
||||||
float descent = 0.0;
|
|
||||||
int32 offset = fromOffset;
|
int32 offset = fromOffset;
|
||||||
int32 delta = 0;
|
|
||||||
float deltaWidth = 0.0;
|
|
||||||
float tabWidth = 0.0;
|
|
||||||
float strWidth = 0.0;
|
|
||||||
|
|
||||||
// do we need to wrap the text?
|
// Text wrapping is turned off.
|
||||||
|
// Just find the offset of the first \n character
|
||||||
if (!fWrap) {
|
if (!fWrap) {
|
||||||
offset = limit - fromOffset;
|
offset = limit - fromOffset;
|
||||||
fText->FindChar('\n', fromOffset, &offset);
|
fText->FindChar('\n', fromOffset, &offset);
|
||||||
offset += fromOffset;
|
offset += fromOffset;
|
||||||
offset = (offset < limit) ? offset + 1 : limit;
|
offset = (offset < limit) ? offset + 1 : limit;
|
||||||
|
|
||||||
// iterate through the style runs
|
*ioWidth = StyledWidth(fromOffset, offset - fromOffset, outAscent, outDescent);
|
||||||
int32 length = offset;
|
|
||||||
int32 startOffset = fromOffset;
|
|
||||||
int32 numChars;
|
|
||||||
while ((numChars = fStyles->Iterate(startOffset, length, fInline, NULL, NULL, &ascent, &descent)) != 0) {
|
|
||||||
*outAscent = max_c(ascent, *outAscent);
|
|
||||||
*outDescent = max_c(descent, *outDescent);
|
|
||||||
|
|
||||||
startOffset += numChars;
|
|
||||||
length -= numChars;
|
|
||||||
}
|
|
||||||
|
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool done = false;
|
||||||
|
float ascent = 0.0;
|
||||||
|
float descent = 0.0;
|
||||||
|
int32 delta = 0;
|
||||||
|
float deltaWidth = 0.0;
|
||||||
|
float tabWidth = 0.0;
|
||||||
|
float strWidth = 0.0;
|
||||||
|
|
||||||
// wrap the text
|
// wrap the text
|
||||||
do {
|
do {
|
||||||
bool foundTab = false;
|
bool foundTab = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user