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

Unified Diff: ui/gfx/canvas_skia.cc

Issue 614103007: Error in popup on Link (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review 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
Index: ui/gfx/canvas_skia.cc
diff --git a/ui/gfx/canvas_skia.cc b/ui/gfx/canvas_skia.cc
index 2f9bd605ff804d1e3f7793e8193c89ad156fc76d..1aca7b5f21357951eda1187ba6a1f95b33f08fa1 100644
--- a/ui/gfx/canvas_skia.cc
+++ b/ui/gfx/canvas_skia.cc
@@ -176,14 +176,19 @@ void Canvas::SizeStringFloat(const base::string16& text,
Rect rect(*width, INT_MAX);
std::vector<base::string16> strings;
- ElideRectangleText(adjusted_text, font_list, rect.width(), rect.height(),
- wrap_behavior, &strings);
+ float w = 0.0;
+ ElideRectangleText(adjusted_text,
+ font_list,
+ rect.width(),
+ rect.height(),
+ wrap_behavior,
+ &strings,
+ &w);
scoped_ptr<RenderText> render_text(RenderText::CreateInstance());
UpdateRenderText(rect, base::string16(), font_list, flags, 0,
render_text.get());
- float h = 0;
- float w = 0;
+ float h = 0.0;
for (size_t i = 0; i < strings.size(); ++i) {
StripAcceleratorChars(flags, &strings[i]);
render_text->SetText(strings[i]);
@@ -247,8 +252,13 @@ void Canvas::DrawStringRectWithShadows(const base::string16& text,
wrap_behavior = ELIDE_LONG_WORDS;
std::vector<base::string16> strings;
- ElideRectangleText(adjusted_text, font_list, text_bounds.width(),
- text_bounds.height(), wrap_behavior, &strings);
+ ElideRectangleText(adjusted_text,
+ font_list,
+ text_bounds.width(),
+ text_bounds.height(),
+ wrap_behavior,
+ &strings,
+ nullptr);
for (size_t i = 0; i < strings.size(); i++) {
Range range = StripAcceleratorChars(flags, &strings[i]);

Powered by Google App Engine
This is Rietveld 408576698