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

Unified Diff: ui/gfx/canvas.h

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/canvas.h
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h
index 9aa7a0a4e4d6cc126b000520ea9bbca9afcd91f3..9932535d7529e7ded8489fa8e1215eeb88a6dd44 100644
--- a/ui/gfx/canvas.h
+++ b/ui/gfx/canvas.h
@@ -125,26 +125,26 @@ class GFX_EXPORT Canvas {
// height and then width as needed to make the text fit. This method
// supports multiple lines. On Skia only a line_height can be specified and
// specifying a 0 value for it will cause the default height to be used.
- static void SizeStringInt(const base::string16& text,
- const FontList& font_list,
- int* width,
- int* height,
- int line_height,
- int flags);
+ static void SizeStringToFit(const base::string16& text,
+ const FontList& font_list,
+ float* width,
+ float* height,
+ int line_height,
+ int flags);
// Obsolete version. Use the above version which takes FontList.
- static void SizeStringInt(const base::string16& text,
- const Font& font,
- int* width,
- int* height,
- int line_height,
- int flags);
+ static void SizeStringToFit(const base::string16& text,
+ const Font& font,
+ float* width,
+ float* height,
+ int line_height,
+ int flags);
// Returns the number of horizontal pixels needed to display the specified
// |text| with |font_list|.
- static int GetStringWidth(const base::string16& text,
+ static float GetStringWidth(const base::string16& text,
const FontList& font_list);
msw 2013/10/01 02:42:48 nit: indent this line to match the one above.
jianli 2013/10/01 18:56:50 Done.
// Obsolete version. Use the above version which takes FontList.
- static int GetStringWidth(const base::string16& text, const Font& font);
+ static float GetStringWidth(const base::string16& text, const Font& font);
// Returns the default text alignment to be used when drawing text on a
// Canvas based on the directionality of the system locale language.

Powered by Google App Engine
This is Rietveld 408576698