Fix clipping of text due to fractional pixels

This commit is contained in:
Aparajita Fishman
2012-07-10 18:08:33 -07:00
parent 872df9fe39
commit 99cd246ed8
2 changed files with 18 additions and 0 deletions
+10
View File
@@ -680,9 +680,19 @@ var _CPimageAndTextViewFrameSizeChangedFlag = 1 << 0,
{
if (_lineBreakMode === CPLineBreakByCharWrapping ||
_lineBreakMode === CPLineBreakByWordWrapping)
{
_textSize = [_text sizeWithFont:_font inWidth:textRectWidth];
}
else
{
_textSize = [_text sizeWithFont:_font];
// Account for possible fractional pixels at right edge
_textSize.width += 1;
}
// Account for possible fractional pixels at bottom edge
_textSize.height += 1;
}
if (_verticalAlignment === CPCenterVerticalTextAlignment)