diff --git a/src/ChangeLog b/src/ChangeLog index 3543415d93..d4ec2323cb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2003-03-18 John Levon + + * text.C: top_y change means full repaint, fix + a drawing bug with cursor movement + 2003-03-18 Alfredo Braunstein * lyxtext.h: diff --git a/src/text.C b/src/text.C index 5235f1611f..fdd5fa35b5 100644 --- a/src/text.C +++ b/src/text.C @@ -93,10 +93,18 @@ void LyXText::top_y(int newy) lyxerr[Debug::GUI] << "setting top y = " << newy << endl; int y = newy; - anchor_row_ = getRowNearY(y); + Row * row = getRowNearY(y); + + if (row == anchor_row_ && anchor_row_offset_ == newy - y) { + lyxerr[Debug::GUI] << "top_y to same value, skipping update" << endl; + return; + } + + anchor_row_ = row; anchor_row_offset_ = newy - y; lyxerr[Debug::GUI] << "changing reference to row: " << anchor_row_ << " offset: " << anchor_row_offset_ << endl; + postPaint(0); }