change 'cursor down in \frac denominator' behaviour.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2451 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-08-08 09:47:44 +00:00
parent 08c784de22
commit 1cc8461767

View File

@ -1238,6 +1238,82 @@ MathCursorPos const & MathCursor::cursor() const
}
int MathCursor::cellXOffset() const
{
return par()->cellXOffset(idx());
}
int MathCursor::cellYOffset() const
{
return par()->cellYOffset(idx());
}
int MathCursor::xpos() const
{
return cellXOffset() + xarray().pos2x(pos());
}
int MathCursor::ypos() const
{
return cellYOffset();
}
void MathCursor::gotoX(int x)
{
pos() = xarray().x2pos(x - cellXOffset());
}
bool MathCursor::idxUp()
{
int x = par()->xo() + xpos();
do {
if (par()->idxUp(idx(), pos())) {
gotoX(x - par()->xo());
return true;
}
} while (popLeft());
gotoX(x - par()->xo());
return true;
}
bool MathCursor::idxDown()
{
int x = par()->xo() + xpos();
do {
if (par()->idxDown(idx(), pos())) {
gotoX(x - par()->xo());
return true;
}
} while (popLeft());
gotoX(x - par()->xo());
return true;
}
bool MathCursor::idxLeft()
{
return par()->idxLeft(idx(), pos());
}
bool MathCursor::idxRight()
{
return par()->idxRight(idx(), pos());
}
MathMatrixInset * MathCursor::outerPar() const
{
return
static_cast<MathMatrixInset *>(const_cast<MathInset *>(formula_->par()));
}
////////////////////////////////////////////////////////////////////////
@ -1293,73 +1369,3 @@ MathCursorPos MathCursor::normalAnchor() const
}
return normal;
}
int MathCursor::cellXOffset() const
{
return par()->cellXOffset(idx());
}
int MathCursor::cellYOffset() const
{
return par()->cellYOffset(idx());
}
int MathCursor::xpos() const
{
return cellXOffset() + xarray().pos2x(pos());
}
int MathCursor::ypos() const
{
return cellYOffset();
}
void MathCursor::gotoX(int x)
{
pos() = xarray().x2pos(x - cellXOffset());
}
bool MathCursor::idxUp()
{
int x = xpos();
if (!par()->idxUp(idx(), pos()))
return false;
gotoX(x);
return true;
}
bool MathCursor::idxDown()
{
int x = xpos();
if (!par()->idxDown(idx(), pos()))
return false;
gotoX(x);
return true;
}
bool MathCursor::idxLeft()
{
return par()->idxLeft(idx(), pos());
}
bool MathCursor::idxRight()
{
return par()->idxRight(idx(), pos());
}
MathMatrixInset * MathCursor::outerPar() const
{
return
static_cast<MathMatrixInset *>(const_cast<MathInset *>(formula_->par()));
}