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

Unified Diff: ui/gfx/render_text.cc

Issue 1018463004: Fix focus rectangle for label. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GetFocusBounds Created 5 years, 9 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
« no previous file with comments | « ui/gfx/render_text.h ('k') | ui/views/controls/label.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « ui/gfx/render_text.h ('k') | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698