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

Unified Diff: ui/message_center/views/bounded_label.cc

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 7 years, 3 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/message_center/views/bounded_label.cc
diff --git a/ui/message_center/views/bounded_label.cc b/ui/message_center/views/bounded_label.cc
index 9c6f4df5840afe0c412a3bf41f54469de012e14c..89f4f8f9b1fcdec7b0bb8a9f0aa2c5d7f446c377 100644
--- a/ui/message_center/views/bounded_label.cc
+++ b/ui/message_center/views/bounded_label.cc
@@ -106,9 +106,9 @@ gfx::Size InnerBoundedLabel::GetSizeForWidthAndLines(int width, int lines) {
gfx::Size size = GetCachedSize(key);
if (size.height() == std::numeric_limits<int>::max()) {
gfx::Insets insets = owner_->GetInsets();
- int text_width = (width < 0) ? std::numeric_limits<int>::max() :
- std::max(width - insets.width(), 0);
- int text_height = std::numeric_limits<int>::max();
+ float text_width = (width < 0) ? std::numeric_limits<int>::max() :
+ std::max(width - insets.width(), 0);
+ float text_height = std::numeric_limits<int>::max();
std::vector<string16> wrapped = GetWrappedText(text_width, lines);
gfx::Canvas::SizeStringInt(JoinString(wrapped, '\n'), font(),
&text_width, &text_height,

Powered by Google App Engine
This is Rietveld 408576698