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

Unified Diff: ui/gfx/render_text.cc

Issue 915383003: Fix alignment format in multiline mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 e04fc71b3bdc1ae1c3e861a65f5560b97158499c..b807b6e07505eb79ebf75d93d2847003e6f247b1 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -1092,14 +1092,14 @@ HorizontalAlignment RenderText::GetCurrentHorizontalAlignment() {
}
Vector2d RenderText::GetAlignmentOffset(size_t line_number) {
- // TODO(ckocagil): Enable |lines_| usage in other platforms.
-#if defined(OS_WIN)
+ // TODO(ckocagil): Enable |lines_| usage on mac.
msw 2015/02/23 19:30:06 nit: update this comment to say RenderTextMac inst
oshima 2015/02/23 23:06:52 Done.
+#if !defined(OS_MACOSX)
DCHECK_LT(line_number, lines_.size());
#endif
Vector2d offset;
HorizontalAlignment horizontal_alignment = GetCurrentHorizontalAlignment();
if (horizontal_alignment != ALIGN_LEFT) {
-#if defined(OS_WIN)
+#if !defined(OS_MACOSX)
const int width = std::ceil(lines_[line_number].size.width()) +
(cursor_enabled_ ? 1 : 0);
#else

Powered by Google App Engine
This is Rietveld 408576698