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

Issue 378723003: RenderText: Allow setting display offset explicitly (Closed)

Created:
6 years, 5 months ago by mohsen
Modified:
6 years, 5 months ago
Reviewers:
msw
CC:
chromium-reviews, ckocagil
Project:
chromium
Visibility:
Public.

Description

RenderText: Allow setting display offset explicitly Currently, display offset for a gfx::RenderText is computed automatically to ensure the cursor is always visible. This CL adds the ability to set display offset explicitly which, as an example, can be useful in adding touch scrolling to textfields. Display offset set this way is not permanent and will be recalculated next time a property (text, font, alignment, etc.) is changed. BUG=388862 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282308

Patch Set 1 #

Total comments: 4

Patch Set 2 : Pass only horizontal offset #

Patch Set 3 : Fixed center-aligned texts #

Patch Set 4 : Added test #

Total comments: 1

Patch Set 5 : nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+114 lines, -8 lines) Patch
M ui/gfx/render_text.h View 1 2 chunks +3 lines, -2 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 4 2 chunks +36 lines, -5 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 2 chunks +75 lines, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
mohsen
Can you take a look, please...
6 years, 5 months ago (2014-07-08 00:11:45 UTC) #1
msw
Have you tested using the setter (with left/right/center-aligned text)? This seems mostly correct, but I'd ...
6 years, 5 months ago (2014-07-08 17:38:24 UTC) #2
mohsen
I have tested the setter with left- and right-aligned text manually by implementing touch scrolling ...
6 years, 5 months ago (2014-07-08 18:36:16 UTC) #3
mohsen
I've fixed the issue with center-aligned texts and added some tests. Please take a look...
6 years, 5 months ago (2014-07-09 21:22:30 UTC) #4
msw
nice; lgtm. https://codereview.chromium.org/378723003/diff/120001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/378723003/diff/120001/ui/gfx/render_text.cc#newcode881 ui/gfx/render_text.cc:881: int extra_content = GetContentWidth() - display_rect_.width(); nit: ...
6 years, 5 months ago (2014-07-10 00:28:54 UTC) #5
mohsen
The CQ bit was checked by mohsen@chromium.org
6 years, 5 months ago (2014-07-10 06:15:53 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mohsen@chromium.org/378723003/140001
6 years, 5 months ago (2014-07-10 06:16:20 UTC) #7
commit-bot: I haz the power
6 years, 5 months ago (2014-07-10 11:15:05 UTC) #8
Message was sent while issue was closed.
Change committed as 282308

Powered by Google App Engine
This is Rietveld 408576698