From d605048b5c3efd3088c4db31147a633284ec30c9 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Thu, 9 Oct 2014 22:09:33 +0200 Subject: [PATCH] Fix ticket #9276: Labeling cursor off by several characters The length of STRING row elements is not updated until finalizeLast() is called. --- src/TextMetrics.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index eb71f74f1c..c99517c517 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -849,6 +849,8 @@ void TextMetrics::breakRow(Row & row, int const right_margin, pit_type const pit // before body_pos. Instead, insert some spacing to // align text FontMetrics const & fm = theFontMetrics(text_->labelFont(par)); + // this is needed to make sure that the row width is correct + row.finalizeLast(); int const add = max(fm.width(par.layout().labelsep), labelEnd(pit) - row.width()); row.addSpace(i, add, *fi, par.lookupChange(i));