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

Unified Diff: ui/gfx/canvas_skia.cc

Issue 692803004: For multiline text use the maximum of the string height and the line height while calculating the h… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed build error Created 6 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas_skia.cc
diff --git a/ui/gfx/canvas_skia.cc b/ui/gfx/canvas_skia.cc
index dc35eeda4f56b1b054f63dd2ccb162d19706d94d..a0d3705ca4ca6ff2d9397c8b0162a2090bfcd3ad 100644
--- a/ui/gfx/canvas_skia.cc
+++ b/ui/gfx/canvas_skia.cc
@@ -191,7 +191,9 @@ void Canvas::SizeStringFloat(const base::string16& text,
render_text->SetText(strings[i]);
const SizeF& string_size = render_text->GetStringSizeF();
w = std::max(w, string_size.width());
- h += (i > 0 && line_height > 0) ? line_height : string_size.height();
+ h += (i > 0 && line_height > 0) ?
+ std::max(static_cast<float>(line_height), string_size.height())
+ : string_size.height();
}
*width = w;
*height = h;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698