mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
Always prefer breaking at word boundaries
An overlong word containing a hyphen could be broken anywhere, instead of after the hyphen. Example: compare the line breaking of aaaaa-aaaaa-aaaaa-aaaaa with aaa aaaaa-aaaaa-aaaaa-aaaaa (with a very narrow window) This also improves Chinese text in some situations (#10299)
This commit is contained in:
parent
b30f8d3c4b
commit
50ccbd2eab
@ -303,7 +303,8 @@ bool GuiFontMetrics::breakAt(docstring & s, int & x, bool const rtl, bool const
|
||||
tl.setText(qs);
|
||||
tl.setFont(font_);
|
||||
QTextOption to;
|
||||
to.setWrapMode(force ? QTextOption::WrapAnywhere : QTextOption::WordWrap);
|
||||
to.setWrapMode(force ? QTextOption::WrapAtWordBoundaryOrAnywhere
|
||||
: QTextOption::WordWrap);
|
||||
tl.setTextOption(to);
|
||||
tl.beginLayout();
|
||||
QTextLine line = tl.createLine();
|
||||
|
Loading…
Reference in New Issue
Block a user