// returns the column near the specified x-coordinate of the row
// x is set to the real beginning of this column
pos_type TextMetrics::getPosNearX(Row const & row, int & x,
- bool & boundary) const
+ bool & boundary, bool const select) const
{
//LYXERR0("getPosNearX(" << x << ") row=" << row);
/// For the main Text, it is possible that this pit is not
for ( ; cit != cend; ++cit) {
if (w <= x && w + cit->full_width() > x) {
int x_offset = int(x - w);
- pos = cit->x2pos(x_offset);
+ pos = cit->x2pos(x_offset, select);
x = int(x_offset + w);
break;
}
}
-void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x, int const y)
+void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x,
+ int const y, bool const select)
{
LASSERT(text_ == cur.text(), return);
pit_type const pit = getPitNearY(y);
bool bound = false;
int xx = x;
- pos_type const pos = getPosNearX(row, xx, bound);
+ pos_type const pos = getPosNearX(row, xx, bound, select);
LYXERR(Debug::DEBUG, "setting cursor pit: " << pit << " pos: " << pos);