]> git.lyx.org Git - lyx.git/commit
Fix length of hfills
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 13 Nov 2015 09:57:26 +0000 (10:57 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 24 Nov 2015 09:11:17 +0000 (10:11 +0100)
commit1f0305509b99681885958c03f8d8f04c1564c84c
treebbc3152efccbf6c07bb4c1d935bc21470e934909
parentf6bcf2a29e66dd76572e86d83bb57537c5bb36a3
Fix length of hfills

The computation of the legth of expanded hfills did not take into account their unexpanded size. This is done now by increasing the dimension (+=) instead of merely setting it.

Moreover, since the insets sizes are integer number, rounding effects have to be taken in account. To this end, the extra number of pixels is added to the last hfill in the row.

This fixes part of bug #9860.

Note not everything is fixed by this patch: the logic of ParagraphMetrics::hfillExpansion seems bogus to me. I do not see why consecutive hfills at the beginning of a row should not be all expanded. Since I do not know what are the peculiarities of hfill handling in LaTeX, I did not change it (yet).

I did not either try to investigate the label hfill part, because I do not even know what is so special about it. I think there is a lot of old logic that nobody ever tried to question.
src/ParagraphMetrics.cpp
src/TextMetrics.cpp
src/insets/InsetSpace.cpp