Index: ui/gfx/render_text.cc |
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc |
index c9fe334e585135a77199c41d03c0b6bb3efcb1f7..2b51d8aa8c75156871e18fda188ba726cad0c33a 100644 |
--- a/ui/gfx/render_text.cc |
+++ b/ui/gfx/render_text.cc |
@@ -939,6 +939,17 @@ void RenderText::SetDisplayOffset(int horizontal_offset) { |
cursor_bounds_ = GetCursorBounds(selection_model_, insert_mode_); |
} |
+Vector2d RenderText::GetLineOffset(size_t line_number) { |
+ Vector2d offset = display_rect().OffsetFromOrigin(); |
+ // TODO(ckocagil): Apply the display offset for multiline scrolling. |
+ if (!multiline()) |
+ offset.Add(GetUpdatedDisplayOffset()); |
+ else |
+ offset.Add(Vector2d(0, lines_[line_number].preceding_heights)); |
+ offset.Add(GetAlignmentOffset(line_number)); |
+ return offset; |
+} |
+ |
RenderText::RenderText() |
: horizontal_alignment_(base::i18n::IsRTL() ? ALIGN_RIGHT : ALIGN_LEFT), |
directionality_mode_(DIRECTIONALITY_FROM_TEXT), |
@@ -1067,17 +1078,6 @@ void RenderText::UndoCompositionAndSelectionStyles() { |
composition_and_selection_styles_applied_ = false; |
} |
-Vector2d RenderText::GetLineOffset(size_t line_number) { |
- Vector2d offset = display_rect().OffsetFromOrigin(); |
- // TODO(ckocagil): Apply the display offset for multiline scrolling. |
- if (!multiline()) |
- offset.Add(GetUpdatedDisplayOffset()); |
- else |
- offset.Add(Vector2d(0, lines_[line_number].preceding_heights)); |
- offset.Add(GetAlignmentOffset(line_number)); |
- return offset; |
-} |
- |
Point RenderText::ToTextPoint(const Point& point) { |
return point - GetLineOffset(0); |
// TODO(ckocagil): Convert multiline view space points to text space. |