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

Unified Diff: ui/gfx/render_text_mac.cc

Issue 24883002: Uses and returns the fractional width in text eliding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedbacks Created 7 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/render_text_mac.cc
diff --git a/ui/gfx/render_text_mac.cc b/ui/gfx/render_text_mac.cc
index 2fcea01b157dee17421a5af1de7c14adfef65601..d86975d063081de323c38633d541dcc5b9c26cd3 100644
--- a/ui/gfx/render_text_mac.cc
+++ b/ui/gfx/render_text_mac.cc
@@ -25,6 +25,11 @@ RenderTextMac::~RenderTextMac() {
Size RenderTextMac::GetStringSize() {
EnsureLayout();
+ return Size(std::ceil(string_size_.width()), string_size_.height());
+}
+
+SizeF RenderTextMac::GetStringSizeF() {
+ EnsureLayout();
return string_size_;
}
@@ -149,7 +154,7 @@ void RenderTextMac::EnsureLayout() {
CGFloat font_list_baseline = font_list().GetBaseline();
ascent = std::max(ascent, font_list_baseline);
descent = std::max(descent, font_list_height - font_list_baseline);
- string_size_ = Size(std::ceil(width), ascent + descent + leading);
+ string_size_ = SizeF(width, ascent + descent + leading);
common_baseline_ = ascent;
}

Powered by Google App Engine
This is Rietveld 408576698