| Index: ui/gfx/canvas_skia.cc
|
| diff --git a/ui/gfx/canvas_skia.cc b/ui/gfx/canvas_skia.cc
|
| index b6830d556c6be7b56242e9ef3f100391bb352805..56927293196d20d0262319582abab45f89ace483 100644
|
| --- a/ui/gfx/canvas_skia.cc
|
| +++ b/ui/gfx/canvas_skia.cc
|
| @@ -167,11 +167,12 @@ int AdjustPlatformSpecificFlags(const base::string16& text, int flags) {
|
| } // namespace
|
|
|
| // static
|
| -void Canvas::SizeStringInt(const base::string16& text,
|
| - const FontList& font_list,
|
| - int* width, int* height,
|
| - int line_height,
|
| - int flags) {
|
| +void Canvas::SizeStringToFit(const base::string16& text,
|
| + const FontList& font_list,
|
| + float* width,
|
| + float* height,
|
| + int line_height,
|
| + int flags) {
|
| DCHECK_GE(*width, 0);
|
| DCHECK_GE(*height, 0);
|
|
|
| @@ -198,12 +199,12 @@ void Canvas::SizeStringInt(const base::string16& text,
|
| UpdateRenderText(rect, base::string16(), font_list, flags, 0,
|
| render_text.get());
|
|
|
| - int h = 0;
|
| - int w = 0;
|
| + float h = 0;
|
| + float w = 0;
|
| for (size_t i = 0; i < strings.size(); ++i) {
|
| StripAcceleratorChars(flags, &strings[i]);
|
| render_text->SetText(strings[i]);
|
| - const Size& string_size = render_text->GetStringSize();
|
| + const SizeF& string_size = render_text->GetStringSize();
|
| w = std::max(w, string_size.width());
|
| h += (i > 0 && line_height > 0) ? line_height : string_size.height();
|
| }
|
| @@ -222,7 +223,7 @@ void Canvas::SizeStringInt(const base::string16& text,
|
| StripAcceleratorChars(flags, &adjusted_text);
|
| UpdateRenderText(rect, adjusted_text, font_list, flags, 0,
|
| render_text.get());
|
| - const Size& string_size = render_text->GetStringSize();
|
| + const SizeF& string_size = render_text->GetStringSizeF();
|
| *width = string_size.width();
|
| *height = string_size.height();
|
| }
|
|
|