]> git.lyx.org Git - lyx.git/blobdiff - src/screen.C
ws changes
[lyx.git] / src / screen.C
index e3d27a5d084b4faeba9c6755fd6c2d60f9a062ae..83c19bc19a7a471c2d3bafffeb827ab0a4da7daf 100644 (file)
@@ -522,11 +522,12 @@ void LyXScreen::toggleToggle(LyXText * text, BufferView * bv,
                - text->toggle_end_cursor.row()->baseline()
                + text->toggle_end_cursor.row()->height();
 
+       int const offset = y_offset < 0 ? y_offset : 0;
        int const bottom = min(max(bottom_tmp, text->first_y),
-                    static_cast<int>(text->first_y + owner.height()))-y_offset;
+                    static_cast<int>(text->first_y + owner.height()))-offset;
        int const top = min(max(top_tmp, text->first_y),
-                 static_cast<int>(text->first_y + owner.height()))-y_offset;
-       
+                 static_cast<int>(text->first_y + owner.height()))-offset;
+
        drawFromTo(text, bv, top - text->first_y,
                   bottom - text->first_y, y_offset,
                   x_offset);