repair Cursor::x_target mechanism (#10168)

This commit is contained in:
Guillaume Munch 2017-03-19 14:41:54 +01:00
parent ac6d3ffb6a
commit 4f3c3a794e

View File

@ -1906,10 +1906,13 @@ bool Cursor::upDownInText(bool up, bool & updateNeeded)
int yo = bv().getPos(*this).y_;
Cursor old = *this;
// To next/previous row
// FIXME: the y position is often guessed wrongly across styles and
// insets, which leads to weird behaviour.
if (up)
tm.editXY(*this, xo, yo - textRow().ascent() - 1);
else
tm.editXY(*this, xo, yo + textRow().descent() + 1);
x_target_ = old.x_target_;
clearSelection();
// This happens when you move out of an inset.