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

Unified Diff: ui/gfx/canvas.cc

Issue 660953002: Type conversion fixes, text rendering edition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test Created 6 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
« no previous file with comments | « no previous file | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.cc
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index 7ce7c4725ecb39041d534c57fdb26ea3abca8f4b..7508e689708a4ac27420c0996158e250d207e89e 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 = ToCeiledInt(fractional_width);
+ *height = ToCeiledInt(factional_height);
}
// static
« no previous file with comments | « no previous file | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698