Jean-Marc Lasgouttes <lasgouttes <at> lyx.org> writes:

> This works very well! A small nit: when cursor goes to rith right at the 
> end of the visible row, it goes backwards and the forwards. The &0px 
> correction should maybe be applied also to the cursor position when not 
> at the real end of the row.

I tried to fix this and found that this happens because cur_x variable do
mot get updates as expected. I save bv.getPos(cur).x_ to cur_x, as I
discussed with you earlier. But my previous observation seems to be wrong
when compared to cur.targetX(). I tried with cur.targetX() too. But that
also did not solve the problem. 

*Here I am talking about the left corner of Math equation.
What is happening normally is for each key stroke, this cur_x gets updated
once. (If I do not move the mouse pointer)
But just after I enter Math (going from left to right) this gives two 10s;
which should have been one 13. 
When I came to the same position (going from right to left) it gives one 13;
which is correct.
Next when I just got out from the Math (going from right to left) it gives
two 10s; which should have been one 10.
* My algorithm is not working properly only because of the misbehaviour of
moving from left to right at this point. (How many times this value get
update do not affect the algorithm)

*If consider about the right corner of the math equation; what is happening is;
When I inside Math at right corner it gives 2510 and when I press right
arrow once gives two 2511; which should have been one 2511.
Then when I try to get back into Math; it gives two 10s; which should have
been one 2510. That is why the whole row gets slid to the left most edge at
this moment. But when I proceed fro there; the cur_x gives correct values.

*So it is clear that when the cur_x does not get the correct value, when the
cursor just enter the Math inset. (Either from left corner or right corner).
Is this done purposely?
Isn't there single variable that gives the absolute text cursor position all
the time?

Please View this commit.
http://git.lyx.org/?p=gsoc.git;a=commitdiff;h=49006a4af94c9251217965b7d9295357ca7f657a



> > I tried to modify the style in TextMetrics.cpp. Could you please review me
> > that advise me where I need to improve?
> 
> See a few remarks at the end of the message.
Thank you very much for correcting me.


Thanks
Hashini




Reply via email to