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

Unified Diff: ui/gfx/text_elider.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 | « ui/gfx/render_text_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/text_elider.cc
diff --git a/ui/gfx/text_elider.cc b/ui/gfx/text_elider.cc
index 279e5cb3be87ff3142647f3f3ab5d15fde476f97..1bf85d4936761a22cf3351c4fa0e871abbf518bd 100644
--- a/ui/gfx/text_elider.cc
+++ b/ui/gfx/text_elider.cc
@@ -24,6 +24,7 @@
#include "third_party/icu/source/common/unicode/rbbi.h"
#include "third_party/icu/source/common/unicode/uloc.h"
#include "ui/gfx/font_list.h"
+#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/render_text.h"
#include "ui/gfx/text_utils.h"
@@ -211,7 +212,8 @@ base::string16 ElideText(const base::string16& text,
render_text->set_truncate_length(5000);
render_text->SetFontList(font_list);
available_pixel_width = std::ceil(available_pixel_width);
- render_text->SetDisplayRect(gfx::Rect(gfx::Size(available_pixel_width, 1)));
+ render_text->SetDisplayRect(
+ gfx::ToEnclosingRect(gfx::RectF(gfx::SizeF(available_pixel_width, 1))));
render_text->SetElideBehavior(behavior);
render_text->SetText(text);
return render_text->layout_text();
« no previous file with comments | « ui/gfx/render_text_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698