Dear Hashini,

As you probably saw, I just answered to your previous message and sent a patch.

11/09/2013 14:54, Hashini Senaratne:
But after the last commit I think now I can use, left_edge != >
cur.getLeftEdge() too. Although, to me this boolean is more clear. Yes, I
will follow the term you suggest. Hope that is more appropriate.

Keep the boolean.

2/ In this same function, you add a test
       cur.getCurrentRow() != cur.getPreviousRow()

Can you mention cases when this test is not true? In my mind,
previousRow is NULL when the previous row does not need a repaint, and
is non-null only in case where we left a row that was scrolled and need
to repaint it. I agree that the naming is not very good, but still I
wonder about the test you added.

Yes, I used that property along with the other conditions to call a full
update where only needed.
When the left_edge_ != 0, previous_row_ = current_row_. Otherwise
previous_row_ = 0 where cur.getCurrentRow() != cur.getPreviousRow().

Sotty, I do not understand what you mean.

3/ If I understand correctly, the fix that makes stuff work is that you
force a full redraw when a row has been moved. Right?

Yes, I have forced full redraw where only needed. If you try debugging, you
will see that this only get called (will go in to this if condition) when
the below situation happens. So I do not think that is not a good thing to do.

I see what is the effect obtained by the full redraw, but I would be happy if I could avoid it. I do not understand currently why the partial gets the position of the cursor wrong.

Second, could you explain why returning early is a good idea in this case?

cur.getLeftEdge() == 0 happens normally when moving into a new row. And
also, it happens when I select a cursor position within a math inset, using
the mouse pointer. That is because we call setCurrentRow() before this.

left_edge == 0 if it is a new row (when moving into a new row). So with the
above condition true and with left_edge != 0, it indicates that we are on an
already drawn row (where the cursor lies on just before). And as the
selected cursor position is visible on screen, no need of scrolling.

This is actually to avoid unwanted scrolling happens when we are selecting
different cursor positions on a math inset, due to the changing value of '&row'.

OK, I will experiment with this particular case.

JMarc

Reply via email to