Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(889)

Unified Diff: ui/gfx/platform_font_ios.mm

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win bots Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/platform_font_ios.mm
diff --git a/ui/gfx/platform_font_ios.mm b/ui/gfx/platform_font_ios.mm
index cfc69cf4964bfa0b6573220e203300c672a22273..93df0aac90791e93b394e8be43a2fa83e8cb15ba 100644
--- a/ui/gfx/platform_font_ios.mm
+++ b/ui/gfx/platform_font_ios.mm
@@ -51,16 +51,16 @@ int PlatformFontIOS::GetBaseline() const {
return ascent_;
}
-int PlatformFontIOS::GetAverageCharacterWidth() const {
+float PlatformFontIOS::GetAverageCharacterWidth() const {
return average_width_;
}
-int PlatformFontIOS::GetStringWidth(const base::string16& text) const {
+float PlatformFontIOS::GetStringWidth(const base::string16& text) const {
NSString* ns_text = base::SysUTF16ToNSString(text);
return [ns_text sizeWithFont:GetNativeFont()].width;
}
-int PlatformFontIOS::GetExpectedTextWidth(int length) const {
+float PlatformFontIOS::GetExpectedTextWidth(int length) const {
return length * average_width_;
}

Powered by Google App Engine
This is Rietveld 408576698