mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-24 02:35:20 +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)
(cherry picked from commit 50ccbd2eab
)
This commit is contained in:
parent
8a1f936ff1
commit
bac0780b27
@ -282,7 +282,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();
|
||||
|
@ -133,6 +133,9 @@ What's new
|
||||
|
||||
- Fix bad painting of collapsable insets sub-label when selecting (bug 10475).
|
||||
|
||||
- Always prefer breaking lines at word boundaries even for very long words. This
|
||||
fixes line breaking issues most noticeably in languages where spaces are rare
|
||||
such as Chinese (bug 10299).
|
||||
|
||||
* INTERNALS
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user