Skip to content

Commit 8d4d9e7

Browse files
authored
parley: add overflow wrapping (#9683)
1 parent 00e5f59 commit 8d4d9e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/core/textlayout/sharedparley.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ fn layout(text: &str, scale_factor: ScaleFactor, mut options: LayoutOptions) ->
197197
TextWrap::WordWrap => parley::style::WordBreakStrength::Normal,
198198
TextWrap::CharWrap => parley::style::WordBreakStrength::BreakAll,
199199
}));
200+
builder.push_default(parley::StyleProperty::OverflowWrap(match options.text_wrap {
201+
TextWrap::NoWrap => parley::style::OverflowWrap::Normal,
202+
TextWrap::WordWrap | TextWrap::CharWrap => parley::style::OverflowWrap::Anywhere,
203+
}));
200204

201205
builder.push_default(parley::StyleProperty::Brush(Brush {
202206
selection_fill_color: None,

0 commit comments

Comments
 (0)