Hello Jean-Marc,

> I see it too, it is very strange. However, I think the problem is 
> different, because it does not require to go out of the equation. You do 
> not see it because (strangely) your test case contains a math equation 
> in a Title layout[1] and thus with large character. Now take the 
> attached document and arrange the zoom value (Ctrl+mouse wheel) so that 
> an individual character is less than 10 points wide. You should keep the 
> LyX window narrow enough so that the equation is longer than the screen.
> 
> Now look at what happens when the cursor goes past the border of the 
> margin. Do you see something weird?
> 
> The reason for it is the following. Take for example this piece of code:
> 
>       // If need to slide right
>       else if (cur_x <= left_edge) {
>               new_x -= cur_x - 10;
>               cur.setLeftEdge(cur_x - 10);
>               cout<<"Loop 2:"<<left_edge<<" "<<cur_x<<" "<<endl;
>       }
> 
> You compare left_edge to cur_x, and then set it to cur_x - 10. I suspect 
> you would get much better results by doing:
>       else if (cur_x <= left_edge + 10) {
>               left_edge = max(cur_x - 10, 0);
>               new_x -= left_edge;
>               cur.setLeftEdge(left_edge);
>       }
> 
> Of course the same should be done for the right edge case.

I think what you are telling 'weird' is; then the cursor is at the left or
right edge and we are still moving beyond the screen; the text cursor is not
stable (I noticed that the given attachment of yours). 
Is this a correct patch for it?
http://git.lyx.org/?p=gsoc.git;a=commitdiff;h=41e08c018c5c3aba8b0543bbc36ede5dbdc75e53

I slightly changed your suggested one. But as  think it should give the same
output. Please check the above commit.

I checked that with the document you sent and also with the previous test.
It seems to be working well. Still the wrong positions get when entering the
Math equation either from right or left corners. 

But I figured out a new discovery.

When the row slid to a wrong position (say when entering from right corner
leftedge is set to 10 pix unexpectedly); if I move the mouse pointer in to
and out of the document window; without any key pressing position resets to
the current position. So we only need to find out what is missing and force
it call.


> 3 stylistic notes about this code

Thank you I will correct them soon. Some are already corrected in the last
commit.

> Let me recall that I will be in vacation starting Friday. I may have 
> access to internet sporadically, but not to LyX source or to a real 
> computer. For the sake of mid-term evaluation, it would be great if you 
> had pushed to scroll/master a reasonable implementation of horizontal 
> scrolling by then. I am not sure what is the amount of work needed 
> (plenty of small things), it looks like a concrete goal.

Yes, I will do.

Thanks
Hashini




Reply via email to