void ApplyVertAlign()
{
int oldOffset = _yOffset;
if (_autoSize == AutoSizeType.Both || _autoSize == AutoSizeType.Height
|| _verticalAlign == VertAlignType.Top)
_yOffset = 0;
else
{
float dh;
if (_textHeight == 0)
dh = _contentRect.height - this.textFormat.size;
else
dh = _contentRect.height - _textHeight;
if (dh < 0)
dh = 0;
if (_verticalAlign == VertAlignType.Middle)
_yOffset = (int)(dh / 2);
else
_yOffset = (int)dh;
}
if (oldOffset != _yOffset)
{
int cnt = _lines.Count;
for (int i = 0; i < cnt; i++)
_lines[i].y = _lines[i].y2 + _yOffset;
_requireUpdateMesh = true;
}
}