top += height;
float left = (float)line->offset;
int count = 0;
// ищем символ
for (VectorCharInfo::const_iterator sim = line->simbols.begin(); sim != line->simbols.end(); ++sim)
{
if (sim->isColour())
continue;
float fullAdvance = sim->getAdvance() + sim->getBearingX();
if (left + fullAdvance / 2.0f > _value.left)
{
break;
}
left += fullAdvance;
count ++;
}
result += count;
break;
}
if (!lastline)
{
top += height;
result += line->count + line->offcount;
}
}
return result;
}
IntPoint TextView::getCursorPoint(size_t _position)
{
setMin(_position, mLength);
size_t position = 0;
int top = 0;
float left = 0.0f;
{
left = (float)line->offset;
if (position + line->count >= _position)
{
for (VectorCharInfo::const_iterator sim = line->simbols.begin(); sim != line->simbols.end(); ++sim)
{
if (sim->isColour())
continue;
if (position == _position)
break;
position ++;
left += sim->getBearingX() + sim->getAdvance();
}
break;
}
position += line->count + line->offcount;
top += mFontHeight;
}
return IntPoint((int)left, top);
}
const IntSize& TextView::getViewSize() const
{
return mViewSize;
}
size_t TextView::getTextLength() const
{
return mLength;
}
const VectorLineInfo& TextView::getData() const
{
return mLineInfo;
}
} // namespace MyGUI