]> git.lyx.org Git - features.git/commitdiff
Fix bug 5736: http://bugzilla.lyx.org/show_bug.cgi?id=5736.
authorVincent van Ravesteijn <vfr@lyx.org>
Tue, 3 Feb 2009 23:18:41 +0000 (23:18 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Tue, 3 Feb 2009 23:18:41 +0000 (23:18 +0000)
If the current TextMetrics does not contain the paragraph the cursor is in, the screen is recentered. Now, the current TextMetrics should be updated to one that does contain the cursor (as we have just recentered)..

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28341 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text3.cpp

index 9ddcf06a799406ad39bae577ef21869ad5dcaef2..c4373d50b1b5f630c98d1a96627af92194700da6 100644 (file)
@@ -447,8 +447,10 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
 
        BufferView * bv = &cur.bv();
        TextMetrics & tm = bv->textMetrics(this);
-       if (!tm.contains(cur.pit()))
+       if (!tm.contains(cur.pit())) {
                lyx::dispatch(FuncRequest(LFUN_SCREEN_RECENTER));
+               tm = bv->textMetrics(this);
+       }
 
        // FIXME: We use the update flag to indicates wether a singlePar or a
        // full screen update is needed. We reset it here but shall we restore it