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

Unified Diff: ui/gfx/render_text.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.cc
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 6e7fbdad24469926a10a4f425faeeba0e8b7f242..fc8bad161ba30d97809619e18a56736a8315985c 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -644,6 +644,11 @@ VisualCursorDirection RenderText::GetVisualDirectionOfLogicalEnd() {
CURSOR_RIGHT : CURSOR_LEFT;
}
+SizeF RenderText::GetStringSizeF() {
+ const Size size = GetStringSize();
+ return SizeF(size.width(), size.height());
+}
+
int RenderText::GetContentWidth() {
return GetStringSize().width() + (cursor_enabled_ ? 1 : 0);
}

Powered by Google App Engine
This is Rietveld 408576698