Le 26/06/2013 16:09, Hashini Senaratne a écrit :
Jean-Marc Lasgouttes <lasgouttes <at> lyx.org> writes:
OK, what about using TexMetrics::cursorX() or maybe
BufferView::getPos()? The later is what is called by setTargetX.
Nothing that work. I think the reason is when the cursor moves along a row
as a result of key board presses of arrow keys, drawparagraph() method is
not get called. By for mouse presses, drawparagraph() method gets called. Am
I correct? (I think I confirmed this with a little test; but not a proper one)
If so, is there a particular reason for this implementation difference? If
somehow (I do not know how) we set to call drawparagraph() method each time
an arraow key is pressed (even when the cursor is in the same row/
paragraph) will it be a high load to LyX.
There is a mechanism to avoid drawing rows when they are unchanged. Look
for this code in drawParagrph:
// Row signature; has row changed since last paint?
row.setCrc(pm.computeRowSignature(row, bparams));
bool row_has_changed = row.changed();
You can try to set row_has_changed to true and see whether it helps you.
If this does, you can try to modify
ParagraphMetrics::computeRowSignature so that it takes in account the
row signature (please ask if you do not understand how this method works).
JMarc