[Linux] fixed horizontal font alignment

kAlignTop and kAlignBottom should center text horizontally
This commit is contained in:
Andre Rudlaff 2013-01-30 02:04:59 +01:00
parent e02bc8ad30
commit 9b8f3ca01e
1 changed files with 2 additions and 2 deletions

View File

@ -194,11 +194,11 @@ public:
return -1;
}
if (eAlignMask == CCImage::kAlignCenter) {
if (eAlignMask == CCImage::kAlignCenter || eAlignMask == CCImage::kAlignTop || eAlignMask == CCImage::kAlignBottom) {
iRet = (iMaxLineWidth - vLines[iLineIndex].iLineWidth) / 2
- SHIFT6(face->glyph->metrics.horiBearingX );
} else if (eAlignMask == CCImage::kAlignRight) {
} else if (eAlignMask == CCImage::kAlignRight || eAlignMask == CCImage::kAlignTopRight || eAlignMask == CCImage::kAlignBottomRight) {
iRet = (iMaxLineWidth - vLines[iLineIndex].iLineWidth)
- SHIFT6(face->glyph->metrics.horiBearingX );
} else {