mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Small fixes to cursor positioning.
Two small fixed to Row::Element::x2pos: * fix position for elements that are not strings * make rounding match the old code
This commit is contained in:
parent
79014c7551
commit
9ba97a85f0
@ -86,10 +86,12 @@ pos_type Row::Element::x2pos(double &x, bool const low) const
|
|||||||
// lyxerr << " NOT FOUND ";
|
// lyxerr << " NOT FOUND ";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == str.size())
|
if (type == STRING && i == str.size())
|
||||||
x2 = w;
|
x2 = w;
|
||||||
// round to the closest side
|
// round to the closest side. The !rtl is here to obtain the
|
||||||
else if (!low && (x2 - last_w > w - x2)) {
|
// same rounding as with the old code (this is cosmetic and
|
||||||
|
// can be eventually removed).
|
||||||
|
else if (!low && (x2 - last_w + !rtl > w - x2)) {
|
||||||
x2 = w;
|
x2 = w;
|
||||||
++i;
|
++i;
|
||||||
} else
|
} else
|
||||||
|
Loading…
Reference in New Issue
Block a user