From 08a3405181aed8b4c3d60af8cc3ac785b7e189cd Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 11 Feb 2021 17:10:28 +0100 Subject: [PATCH] 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. --- src/TextMetrics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 0f1814cab2..eb339442b9 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -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; -- 2.39.2