Index: ui/gfx/platform_font_ios.mm |
diff --git a/ui/gfx/platform_font_ios.mm b/ui/gfx/platform_font_ios.mm |
index 03f5ddbe75a6e986c4f8d2770369d96a60ba53fe..db72c4f5f03781db016c8979bb813525ea1ae1a4 100644 |
--- a/ui/gfx/platform_font_ios.mm |
+++ b/ui/gfx/platform_font_ios.mm |
@@ -110,7 +110,8 @@ void PlatformFontIOS::CalculateMetrics() { |
height_ = font.lineHeight; |
ascent_ = font.ascender; |
cap_height_ = font.capHeight; |
- average_width_ = [@"x" sizeWithFont:font].width; |
+ NSDictionary* attributes = @{ NSFontAttributeName : font }; |
+ average_width_ = ceilf([@"x" sizeWithAttributes:attributes].width); |
sdefresne
2014/08/13 09:30:37
nit: why not use std::ceil from <cmath> and avoid
stuartmorgan
2014/08/13 14:07:35
Good call; done.
|
} |
//////////////////////////////////////////////////////////////////////////////// |