From 398355981c7770423953df68254e49cc9f62ffc3 Mon Sep 17 00:00:00 2001 From: Gary Qian Date: Mon, 10 Dec 2018 14:03:10 -0800 Subject: [PATCH] Minor comment fix and add TODO. (flutter/engine#7158) --- engine/src/flutter/third_party/txt/src/txt/paragraph.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/engine/src/flutter/third_party/txt/src/txt/paragraph.cc b/engine/src/flutter/third_party/txt/src/txt/paragraph.cc index dd1c7e6718..ff017b661b 100644 --- a/engine/src/flutter/third_party/txt/src/txt/paragraph.cc +++ b/engine/src/flutter/third_party/txt/src/txt/paragraph.cc @@ -479,8 +479,12 @@ void Paragraph::Layout(double width, bool force) { } } - // Exclude trailing whitespace from right-justified lines so the last - // visible character in the line will be flush with the right margin. + // TODO(garyq): Make GetRectsForRange return a zero-width box for the + // excluded whitespace such that the caret placement is correct regardless + // of the index being whitespace or not. + + // Exclude trailing whitespace from right and center-justified lines so the + // last visible character in the line will be flush with the right margin. size_t line_end_index = (paragraph_style_.effective_align() == TextAlign::right || paragraph_style_.effective_align() == TextAlign::center)