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

Unified Diff: ui/gfx/render_text.h

Issue 1013543006: [RenderText] Adding vertical alignment options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed pixel tests on vertical alignment 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
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index a3868d9af0e5cf30a87b1834b853298832df72a8..1c019422132a8c3a9a2b6dffbb5a85e40217d4bb 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -214,6 +214,9 @@ class GFX_EXPORT RenderText {
}
void SetHorizontalAlignment(HorizontalAlignment alignment);
+ VerticalAlignment vertical_alignment() const { return vertical_alignment_; }
+ void SetVerticalAlignment(VerticalAlignment alignment);
+
const FontList& font_list() const { return font_list_; }
void SetFontList(const FontList& font_list);
@@ -647,6 +650,7 @@ class GFX_EXPORT RenderText {
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, BreakRunsByUnicodeBlocks);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, PangoAttributes);
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, StringFitsOwnWidth);
+ FRIEND_TEST_ALL_PREFIXES(RenderTextTest, VerticalAlignment);
// Set the cursor to |position|, with the caret trailing the previous
// grapheme, or if there is no previous grapheme, leading the cursor position.
@@ -683,6 +687,10 @@ class GFX_EXPORT RenderText {
// default is to align left if the application UI is LTR and right if RTL.
HorizontalAlignment horizontal_alignment_;
+ // Vertical alignment of the text with respect to |display_rect_|. The
+ // default is to vertically align middle.
+ VerticalAlignment vertical_alignment_;
+
// The text directionality mode, defaults to DIRECTIONALITY_FROM_TEXT.
DirectionalityMode directionality_mode_;

Powered by Google App Engine
This is Rietveld 408576698