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

Issue 8401032: Correct text y position calculation in RenderTextWin. (Closed)

Created:
9 years, 1 month ago by Alexei Svitkine (slow)
Modified:
9 years, 1 month ago
Reviewers:
msw
CC:
chromium-reviews
Visibility:
Public.

Description

Correct text y position calculation in RenderTextWin. The previous calculation had a problem due to the following logic: SkPoint point(SkPoint::Make(SkIntToScalar(offset.x()), SkIntToScalar(display_rect().height() - offset.y()))); If display_rect().y() was large and height was the height for e.g. one line of text, then when the code subtracted offset.y() (which was based on display_rect().y()), the result was a negative y position (offscreen) for the text. This CL changes the logic to correctly center the text vertically regardless of the y position, which I believe was the intention of the code. BUG=none TEST=Open Chrome with --use-pure-views. Type something into omnibox. Text should be centered in omnibox. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=107625

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+10 lines, -6 lines) Patch
M ui/gfx/render_text_win.cc View 1 3 chunks +10 lines, -6 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Alexei Svitkine (slow)
9 years, 1 month ago (2011-10-27 15:36:12 UTC) #1
msw
LGTM with nits. http://codereview.chromium.org/8401032/diff/1/ui/gfx/render_text_win.cc File ui/gfx/render_text_win.cc (right): http://codereview.chromium.org/8401032/diff/1/ui/gfx/render_text_win.cc#newcode596 ui/gfx/render_text_win.cc:596: base_y += (display_rect().height() - default_style().font.GetHeight()) / ...
9 years, 1 month ago (2011-10-27 18:09:29 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/asvitkine@chromium.org/8401032/3002
9 years, 1 month ago (2011-10-27 18:12:20 UTC) #3
Alexei Svitkine (slow)
> http://codereview.chromium.org/8401032/diff/1/ui/gfx/render_text_win.cc#newcode596 > ui/gfx/render_text_win.cc:596: base_y += (display_rect().height() - > default_style().font.GetHeight()) / 2; > You have ...
9 years, 1 month ago (2011-10-27 18:12:23 UTC) #4
commit-bot: I haz the power
9 years, 1 month ago (2011-10-27 21:21:12 UTC) #5
Change committed as 107625

Powered by Google App Engine
This is Rietveld 408576698