X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FRow.cpp;h=8d89f64e1c06f17af0e315faecbab718889f4da3;hb=28be7d552f62cc02fa86d7f79201d089bfb2d7b5;hp=d6ea7275ba4174753a3a7a1911d62c2730b19c16;hpb=76f3f6eb01ca28e3c7d6c9445f48243e8e05ff11;p=lyx.git diff --git a/src/Row.cpp b/src/Row.cpp index d6ea7275ba..8d89f64e1c 100644 --- a/src/Row.cpp +++ b/src/Row.cpp @@ -95,7 +95,7 @@ double Row::Element::pos2x(pos_type const i) const } -pos_type Row::Element::x2pos(int &x, bool const select) const +pos_type Row::Element::x2pos(int &x) const { //lyxerr << "x2pos: x=" << x << " w=" << width() << " " << *this; size_t i = 0; @@ -112,11 +112,10 @@ pos_type Row::Element::x2pos(int &x, bool const select) const x = isRTL() ? int(full_width()) : 0; break; case INSET: - case SPACE: { - double const boundary = select ? (full_width() + 1) / 2 : full_width(); + case SPACE: // those elements contain only one position. Round to // the closest side. - if (x > boundary) { + if (x > (full_width() + 1) / 2) { x = int(full_width()); i = !isRTL(); } else { @@ -124,7 +123,6 @@ pos_type Row::Element::x2pos(int &x, bool const select) const i = isRTL(); } } - } //lyxerr << "=> p=" << pos + i << " x=" << x << endl; return pos + i; }