Fix ticket #9276: Labeling cursor off by several characters

The length of STRING row elements is not updated until finalizeLast() is called.
This commit is contained in:
Jean-Marc Lasgouttes 2014-10-09 22:09:33 +02:00
parent db2044dc14
commit d605048b5c

View File

@ -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));