Merge pull request #1932 from Weeds/feature_linux-font-alignment

fixed #1689: [Linux] fixed horizontal font alignment.
This commit is contained in:
James Chen 2013-01-29 22:22:01 -08:00
commit 6b0417902c
1 changed files with 2 additions and 2 deletions

View File

@ -195,11 +195,11 @@ public:
return -1; return -1;
} }
if (eAlignMask == CCImage::kAlignCenter) { if (eAlignMask == CCImage::kAlignCenter || eAlignMask == CCImage::kAlignTop || eAlignMask == CCImage::kAlignBottom) {
iRet = (iMaxLineWidth - vLines[iLineIndex].iLineWidth) / 2 iRet = (iMaxLineWidth - vLines[iLineIndex].iLineWidth) / 2
- SHIFT6(face->glyph->metrics.horiBearingX ); - 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) iRet = (iMaxLineWidth - vLines[iLineIndex].iLineWidth)
- SHIFT6(face->glyph->metrics.horiBearingX ); - SHIFT6(face->glyph->metrics.horiBearingX );
} else { } else {