On Fri, Jan 20, 2006 at 10:06:15PM +0200, Martin Vermeer wrote: > On Fri, Jan 20, 2006 at 04:04:36PM +0100, Jean-Marc Lasgouttes wrote: > > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
... > It's snappy for me... BTW there is something rotten also in cursor > positioning _inside_ math arrays, both regarding correctness and speed. About the rottenness, one thing is that in bruteFind2, the co-ordinates xo, yo produced by the cursorPos call are relative, while the arguments coming from the header x, y are absolute... the attached fixes it and now movement between cells in an array, each of which contain multiple stuff, is reasonable. Even x_target is being honoured now inside math. This is just plain right and should go in. BTW, in inset->cursorPos(it.top(), c.boundary() && ((i+1) == it.depth()), xo, yo); what precisely is the (i+1) == it.depth() condition for? Looks nonsensical to me. i is the counter of dociterator positions within the cell and has nothing to do with cursor depth. (Andre' should have had his coffee before trying to code ;-) BTW2, we still have the cursor movement bug that the cursor doesn't move straight into an equation, but moves first to the left side of it, and only then in (to the correct x position too) on the next cursor up/down. This appears to be connected with checkInsetHit and editXY, which ought to be called recursively but don't seem to be. Someone should look into that. - Martin
Index: cursor.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v retrieving revision 1.142 diff -u -p -r1.142 cursor.C --- cursor.C 19 Jan 2006 15:49:20 -0000 1.142 +++ cursor.C 21 Jan 2006 11:58:53 -0000 @@ -97,7 +97,12 @@ namespace { for (size_t i = 0; ; ++i) { int xo; int yo; - it.inset().cursorPos(it.top(), c.boundary() && ((i+1) == it.depth()), xo, yo); + InsetBase const * inset(const_cast<InsetBase *>(&it.inset())); + Point o = theCoords.getInsets().xy(inset); + inset->cursorPos(it.top(), c.boundary() && ((i+1) == it.depth()), xo, yo); + // Convert to absolute + xo += o.x_; + yo += o.y_; double d = (x - xo) * (x - xo) + (y - yo) * (y - yo); // '<=' in order to take the last possible position // this is important for clicking behind \sum in e.g. '\sum_i a'
pgp97jSyQPAdZ.pgp
Description: PGP signature