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

Unified Diff: ui/gfx/canvas.cc

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch 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.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index eb0834ba8d9ac7ed0bd166d4d6a1d420f0074b07..8080dd40be5fd27149f073ee702010c1fdddc61d 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -85,24 +85,24 @@ void Canvas::RecreateBackingCanvas(const Size& size,
// static
void Canvas::SizeStringInt(const base::string16& text,
const Font& font,
- int* width,
- int* height,
+ float* width,
+ float* height,
int line_height,
int flags) {
SizeStringInt(text, FontList(font), width, height, line_height, flags);
}
// static
-int Canvas::GetStringWidth(const base::string16& text,
- const FontList& font_list) {
- int width = 0, height = 0;
+float Canvas::GetStringWidth(const base::string16& text,
+ const FontList& font_list) {
+ float width = 0, height = 0;
SizeStringInt(text, font_list, &width, &height, 0, NO_ELLIPSIS);
return width;
}
// static
-int Canvas::GetStringWidth(const base::string16& text, const Font& font) {
- int width = 0, height = 0;
+float Canvas::GetStringWidth(const base::string16& text, const Font& font) {
+ float width = 0, height = 0;
SizeStringInt(text, FontList(font), &width, &height, 0, NO_ELLIPSIS);
return width;
}

Powered by Google App Engine
This is Rietveld 408576698