]> git.lyx.org Git - features.git/commitdiff
Allow PgUp and PgDwn to put the cursor on the first or last row.
authorVincent van Ravesteijn <vfr@lyx.org>
Sun, 15 Nov 2009 23:53:40 +0000 (23:53 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sun, 15 Nov 2009 23:53:40 +0000 (23:53 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32036 a592a061-630c-0410-9148-cb99ea01b6c8

src/TextMetrics.cpp

index 466942de1e7cfe4bb66475a0e52ebe64e2775ad8..2c74a8c8b6a3a991adb6362d0eeacb38f71a7018 100644 (file)
@@ -1445,8 +1445,8 @@ Row const & TextMetrics::getPitAndRowNearY(int & y, pit_type & pit,
                if (yy + rit->height() > y)
                        break;
 
-       if (assert_in_view && yy + rit->height() != y) {
-               if (!up) {
+       if (assert_in_view) {
+               if (!up && yy + rit->height() > y) {
                        if (rit != pm.rows().begin()) {
                                y = yy;
                                --rit;
@@ -1458,7 +1458,7 @@ Row const & TextMetrics::getPitAndRowNearY(int & y, pit_type & pit,
                                --rit;
                                y = yy;
                        }
-               } else  {
+               } else if (up && yy != y) {
                        if (rit != rlast) {
                                y = yy + rit->height();
                                ++rit;