Fix logic error for spacing of RTL rows

The code referred to vpos (the visible position) instead of pos, the logical one.
This can lead to using the wrong font when computing spaces width.
This commit is contained in:
Jean-Marc 2014-07-25 00:10:10 +02:00
parent 3599285019
commit 6ee39ff90a

View File

@ -736,19 +736,19 @@ void RowPainter::paintText()
} }
// Use font span to speed things up, see above // Use font span to speed things up, see above
if (vpos < font_span.first || vpos > font_span.last) { if (!font_span.inside(pos)) {
font_span = par_.fontSpan(vpos); font_span = par_.fontSpan(pos);
font = text_metrics_.displayFont(pit_, vpos); font = text_metrics_.displayFont(pit_, pos);
// split font span if inline completion is inside // split font span if inline completion is inside
if (font_span.first <= inlineCompletionVPos if (inlineCompletionVPos != -1
&& font_span.last > inlineCompletionVPos) && font_span.inside(inlineCompletionPos.pos()))
font_span.last = inlineCompletionVPos; font_span.last = inlineCompletionPos.pos();
} }
// Note that this value will only be used in // Note that this value will only be used in
// situations where no ligature of composition of // situations where no ligature of composition of
// characters is needed. (see comments alginuses of width_pos). // characters is needed. (see comments in uses of width_pos).
const int width_pos = pm_.singleWidth(pos, font); const int width_pos = pm_.singleWidth(pos, font);
Change const & change = par_.lookupChange(pos); Change const & change = par_.lookupChange(pos);