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

Unified Diff: ui/gfx/font_list.cc

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix round-down problems Created 7 years, 2 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/font_list.cc
diff --git a/ui/gfx/font_list.cc b/ui/gfx/font_list.cc
index 72c877754e59bfeeba9bf63af3ad8f652385d7af..929816092224f108ea25b12df8c47e6017ef854e 100644
--- a/ui/gfx/font_list.cc
+++ b/ui/gfx/font_list.cc
@@ -182,7 +182,7 @@ int FontList::GetCapHeight() const {
return GetPrimaryFont().GetCapHeight();
}
-int FontList::GetStringWidth(const base::string16& text) const {
+float FontList::GetStringWidth(const base::string16& text) const {
// Rely on the primary font metrics for the time being.
// TODO(yukishiino): Not only the first font, all the fonts in the list should
// be taken into account to compute the pixels needed to display |text|.
@@ -195,7 +195,7 @@ int FontList::GetStringWidth(const base::string16& text) const {
return GetPrimaryFont().GetStringWidth(text);
}
-int FontList::GetExpectedTextWidth(int length) const {
+float FontList::GetExpectedTextWidth(int length) const {
// Rely on the primary font metrics for the time being.
return GetPrimaryFont().GetExpectedTextWidth(length);
}
« ui/gfx/canvas.h ('K') | « ui/gfx/font_list.h ('k') | ui/gfx/font_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698