More tweaking of boundary setting at end of row

This commit is contained in:
Jean-Marc 2014-07-28 23:31:32 +02:00
parent 46ee67995d
commit f29e78039d
2 changed files with 7 additions and 4 deletions

View File

@ -250,7 +250,8 @@ ostream & operator<<(ostream & os, Row const & row)
<< " ascent: " << row.dim_.asc << " ascent: " << row.dim_.asc
<< " descent: " << row.dim_.des << " descent: " << row.dim_.des
<< " separator: " << row.separator << " separator: " << row.separator
<< " label_hfill : " << row.label_hfill << "\n"; << " label_hfill: " << row.label_hfill
<< " row_boundary: " << row.right_boundary() << "\n";
double x = row.x; double x = row.x;
Row::Elements::const_iterator it = row.elements_.begin(); Row::Elements::const_iterator it = row.elements_.begin();
for ( ; it != row.elements_.end() ; ++it) { for ( ; it != row.elements_.end() ; ++it) {

View File

@ -1144,12 +1144,14 @@ pos_type TextMetrics::getPosNearX(Row const & row, int & x,
} }
/** This tests for the case where the cursor is set at the end /** This tests for the case where the cursor is set at the end
* of a row which has been broken due to a display inset on * of a row which has been broken due something else than a
* next row. This is indicated by Row::right_boundary. * separator (a display inset or a forced breaking of the
* row). We know that there is a separator when the end of the
* row is larger than the end of its last element.
*/ */
if (!row.empty() && pos == row.back().endpos if (!row.empty() && pos == row.back().endpos
&& row.back().endpos == row.endpos()) && row.back().endpos == row.endpos())
boundary = row.right_boundary(); boundary = true;
x += xo; x += xo;
return pos; return pos;