mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Fix clipping of text due to fractional pixels
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user