mirror of https://github.com/axmolengine/axmol.git
Merge pull request #1932 from Weeds/feature_linux-font-alignment
fixed #1689: [Linux] fixed horizontal font alignment.
This commit is contained in:
commit
6b0417902c
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue