getPosNearX, which is the only user of x2pos, should always return the
nearest position.
In editXY, there is a need to return the position where the inset
stands, but it is done using checkInsetHit.
This is a simplification of commit
eb4a2a19, which has been reverted
at
01f0ab64a.
Fixes part of bug #10569.
case SPACE:
// those elements contain only one position. Round to
// the closest side.
case SPACE:
// those elements contain only one position. Round to
// the closest side.
- if (x > full_width()) {
+ if (x > full_width() / 2) {
x = int(full_width());
i = !isRTL();
} else {
x = 0;
i = isRTL();
}
x = int(full_width());
i = !isRTL();
} else {
x = 0;
i = isRTL();
}
}
//lyxerr << "=> p=" << pos + i << " x=" << x << endl;
return pos + i;
}
//lyxerr << "=> p=" << pos + i << " x=" << x << endl;
return pos + i;