Chromium Code Reviews| Index: ui/gfx/canvas.cc |
| diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc |
| index 7ce7c4725ecb39041d534c57fdb26ea3abca8f4b..5ba9385e1dc85724fcc71f1791bc27746fcb83e2 100644 |
| --- a/ui/gfx/canvas.cc |
| +++ b/ui/gfx/canvas.cc |
| @@ -92,12 +92,12 @@ void Canvas::SizeStringInt(const base::string16& text, |
| int* height, |
| int line_height, |
| int flags) { |
| - float fractional_width = *width; |
| - float factional_height = *height; |
| + float fractional_width = static_cast<float>(*width); |
| + float factional_height = static_cast<float>(*height); |
| SizeStringFloat(text, font_list, &fractional_width, |
| &factional_height, line_height, flags); |
| - *width = std::ceil(fractional_width); |
| - *height = std::ceil(factional_height); |
| + *width = static_cast<int>(std::ceil(fractional_width)); |
|
msw
2014/10/17 22:13:23
nit q: DCHECK when the int type can't support the
Peter Kasting
2014/10/21 01:20:45
Changed to ToCeiledInt() for these, which saturate
|
| + *height = static_cast<int>(std::ceil(factional_height)); |
| } |
| // static |