From f29e78039d31be11ad62190384eee7ab14061e52 Mon Sep 17 00:00:00 2001 From: Jean-Marc Date: Mon, 28 Jul 2014 23:31:32 +0200 Subject: [PATCH] More tweaking of boundary setting at end of row --- src/Row.cpp | 3 ++- src/TextMetrics.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Row.cpp b/src/Row.cpp index 34be0529aa..023286e9cd 100644 --- a/src/Row.cpp +++ b/src/Row.cpp @@ -250,7 +250,8 @@ ostream & operator<<(ostream & os, Row const & row) << " ascent: " << row.dim_.asc << " descent: " << row.dim_.des << " separator: " << row.separator - << " label_hfill : " << row.label_hfill << "\n"; + << " label_hfill: " << row.label_hfill + << " row_boundary: " << row.right_boundary() << "\n"; double x = row.x; Row::Elements::const_iterator it = row.elements_.begin(); for ( ; it != row.elements_.end() ; ++it) { diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 0e16ab42b0..2927ca8e9d 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -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 - * of a row which has been broken due to a display inset on - * next row. This is indicated by Row::right_boundary. + * of a row which has been broken due something else than a + * 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 && row.back().endpos == row.endpos()) - boundary = row.right_boundary(); + boundary = true; x += xo; return pos;