mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 19:25:39 +00:00
Row::Element::x2pos: go to nearest point also over insets
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 commiteb4a2a19
, which has been reverted at01f0ab64a
. Fixes part of bug #10569.
This commit is contained in:
parent
01f0ab64a7
commit
8769c0fb75
@ -115,14 +115,13 @@ pos_type Row::Element::x2pos(int &x) const
|
|||||||
case SPACE:
|
case SPACE:
|
||||||
// those elements contain only one position. Round to
|
// those elements contain only one position. Round to
|
||||||
// the closest side.
|
// the closest side.
|
||||||
if (x > full_width()) {
|
if (x > full_width() / 2) {
|
||||||
x = int(full_width());
|
x = int(full_width());
|
||||||
i = !isRTL();
|
i = !isRTL();
|
||||||
} else {
|
} else {
|
||||||
x = 0;
|
x = 0;
|
||||||
i = isRTL();
|
i = isRTL();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//lyxerr << "=> p=" << pos + i << " x=" << x << endl;
|
//lyxerr << "=> p=" << pos + i << " x=" << x << endl;
|
||||||
return pos + i;
|
return pos + i;
|
||||||
|
Loading…
Reference in New Issue
Block a user