Fix correction of row in getPitAndRowNearY

Now that the ascent of the paragraph metrics is not necessarily the
ascent of the first row (see 907f0207), the test is too strict. Now it
is more symmetrical wrt the !up case.

Note that changing this part of code is associated with a
non-negligible risk of creating a bug elsewhere.

Fixes part of bug #12123.
This commit is contained in:
Jean-Marc Lasgouttes 2021-02-11 17:10:28 +01:00
parent b75fc70561
commit 08a3405181

View File

@ -1371,7 +1371,7 @@ Row const & TextMetrics::getPitAndRowNearY(int & y, pit_type & pit,
--rit;
y = yy;
}
} else if (up && yy != y) {
} else if (up && yy < y) {
if (rit != rlast) {
y = yy + rit->height();
++rit;