mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-10 02:40:59 +00:00
Fixed: - (CGSize)sizeWithFont:(CPFont)aFont inWidth:(float)aWidth adjust +1 to the computed size
The width computing of a string is always a little random, and that led to truncated labels. This patch adds a pixel in width in order to fix any rounding errors.
This commit is contained in:
1 parent
57f2d3e26a
commit
48276f989f
2 files changed
+1
-7
No files matched your search
@@ -151,7 +151,7 @@ var DOMFixedWidthSpanElement = nil,
|
||||
else if (CPFeatureIsCompatible(CPJavaScriptTextContentFeature))
|
||||
span.textContent = aString;
|
||||
|
||||
return CGSizeMake(span.clientWidth, span.clientHeight);
|
||||
return CGSizeMake(span.clientWidth + 1, span.clientHeight);
|
||||
}
|
||||
|
||||
+ (CPDictionary)metricsOfFont:(CPFont)aFont
|
||||
|
||||
@@ -118,12 +118,6 @@ var _CPToolTipHeight = 24.0,
|
||||
textFrameSizeSingleLine = [aText sizeWithFont:font],
|
||||
textFrameSize = [aText sizeWithFont:font inWidth:(aToolTipSize.width)];
|
||||
|
||||
// this small adjustement seems to fix all
|
||||
// tooltips sizing issues. Now I'm not sure why
|
||||
// we need this.
|
||||
textFrameSizeSingleLine.width += 1;
|
||||
textFrameSize.width += 1;
|
||||
|
||||
// If the text fully fits within the maximum width, shrink to fit.
|
||||
if (textFrameSizeSingleLine.width < aToolTipSize.width)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user