Le 24/08/2013 19:24, Hashini Senaratne a écrit :
But once we know that the row has to be slid, we could maybe draw it a
first time (it is possible to draw without actually drawing) to get
positions, and then do it a second time. Or we need to find what is the
place where this update happens.
I tried drawing twice, but that did not overwrite the line. What I ended up
with was, duplication content of the same line, where I cannot go
through the duplicated content using arrow keys. Also I could not get an
output which fixes the current wrong sliding.
I have to catcvh my train soon, but the idea is the folowing: when
drawing a row, two things happen at the same time for insets:
1/ their position is computed
2/ they are painted.
If we disable the drawing part (by disabling drawing in the painter),
then we will just compute the positions. This is what is already done in
drawParagrapĥ:
// It is not needed to draw on screen if we are not inside.
pi.pain.setDrawingEnabled(inside && original_drawing_state);
The code above is useful to ompute the inset positions for the page
before and the page after the current page (this in turn is useful for
making page up/down work). Then drwaing the rows that are outside of
screen will not draw anything, but will compute poistions.
Here, what we want to do before looking at left_edge is probably
// It is not needed to draw on screen if we are not inside.
pi.pain.setDrawingEnabled(inside && original_drawing_state);
RowPainter rp(pi, *text_, pit, row, bidi, x, y);
rp.paintOnlyInsets();
pi.pain.setDrawingEnabled(inside && original_drawing_state);
The effect is that the insets positions are updated, but no drawing
occur. This should address the position problem.
Then there is the problem of actually drawing the row, which will be
addressed in my other answer.
I see that I am really out of the schedule. But I feel like, it is worthless
to try moving the next stage, without completing the first half correctly.
And if I get succeed in fixing these, it would be easier to implement the
next step.
I agree with you. The first thing to do is to really make cursor support
good, since nothing else will work otherwise. It might be that the GUI
part is significantly easier afterwards. I hope this week (where I will
not be very available) will be useful anyway. Do not hesitate to send
messages to me, I'll see what I can do.
JMarc