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

Unified Diff: ui/gfx/render_text.cc

Issue 1015533016: Move allow_character_break property to RenderText. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: line width for truncated words 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/gfx/render_text_harfbuzz.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 0fbf10f6d4c19e494c36477a3b6615b4d19989e3..d9c3c2499f79fa9dfbe1aeea0b9fcbb4849df667 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -532,6 +532,17 @@ void RenderText::SetMultiline(bool multiline) {
}
}
+void RenderText::SetWordWrapBehavior(WordWrapBehavior behavior) {
+ if (word_wrap_behavior_ == behavior)
+ return;
+ word_wrap_behavior_ = behavior;
+ if (multiline_) {
+ cached_bounds_and_offset_valid_ = false;
+ lines_.clear();
+ OnTextAttributeChanged();
+ }
+}
+
void RenderText::SetReplaceNewlineCharsWithSymbols(bool replace) {
if (replace_newline_chars_with_symbols_ == replace)
return;
@@ -976,6 +987,7 @@ RenderText::RenderText()
text_elided_(false),
min_line_height_(0),
multiline_(false),
+ word_wrap_behavior_(IGNORE_LONG_WORDS),
replace_newline_chars_with_symbols_(true),
subpixel_rendering_suppressed_(false),
clip_to_display_rect_(true),
« no previous file with comments | « ui/gfx/render_text.h ('k') | ui/gfx/render_text_harfbuzz.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698