]> git.lyx.org Git - features.git/commit
Handle the case where breakAt cuts after trailing space
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 31 Aug 2021 13:58:56 +0000 (15:58 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 23 Nov 2021 15:31:30 +0000 (16:31 +0100)
commitf7dde3d7748e3bbd4b3f0fbd1979dc04fb7c6dae
tree7275312f6dcfffcb20fd7faabc296fdfb32465f8
parent099cc953a2025bb2323abe365b8ffa08b2a59dd7
Handle the case where breakAt cuts after trailing space

In this case, the extra element returned should empty but valid. The
row flag BreakAfter is set to indicate that we have a break there
(this principle will be used more generally in a forthcoming commit).

To detect that we cut at the trailing space, it is necessary to rely
on the difference between QTextLine::horizontalAdvance() and
QTextLine::naturalTextWidth() when the flag
QTextOption::IncludeTrailingSpaces is used: the trailing space is
taken into account in the later, but not in the former.

Somme comments have been added to make code intent clearer.
src/Row.cpp
src/TextMetrics.cpp
src/frontends/qt/GuiFontMetrics.cpp