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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 2767163003: Vertically center multi-line RenderTextHarfBuzz that uses SetMinLineHeight(). (Closed)
Patch Set: respond to comments Created 3 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.cc ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index cbc9c27ec877f99aaa89cf87bd62b75a6db1bbe7..18ee267ef34e619af2afca6b67513a449a577ca1 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -1215,9 +1215,10 @@ void RenderTextHarfBuzz::EnsureLayout() {
FROM_HERE_WITH_EXPLICIT_FUNCTION("441028 HarfBuzzLineBreaker")));
internal::TextRunList* run_list = GetRunList();
+ const int height = std::max(font_list().GetHeight(), min_line_height());
HarfBuzzLineBreaker line_breaker(
- display_rect().width(), font_list().GetBaseline(),
- std::max(font_list().GetHeight(), min_line_height()),
+ display_rect().width(),
+ DetermineBaselineCenteringText(height, font_list()), height,
word_wrap_behavior(), GetDisplayText(),
multiline() ? &GetLineBreaks() : nullptr, *run_list);
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698