mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-04 09:53:41 +00:00
Fix clipping of text due to fractional pixels
This commit is contained in:
@@ -1042,8 +1042,16 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
textSize = [text sizeWithFont:font inWidth:textSize.width];
|
||||
}
|
||||
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;
|
||||
|
||||
frameSize.height = textSize.height + contentInset.top + contentInset.bottom;
|
||||
|
||||
if ([self isBezeled])
|
||||
|
||||
@@ -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