From ee9aed9a410b021d0f9c1143451e5b3f4c1de9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Thu, 14 Aug 2003 13:16:05 +0000 Subject: [PATCH] speedup scrolling. UserGuide should be back to normal. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7543 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/rowpainter.C | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/rowpainter.C b/src/rowpainter.C index ff4905e262..4b058bf130 100644 --- a/src/rowpainter.C +++ b/src/rowpainter.C @@ -1067,6 +1067,14 @@ int getLengthMarkerHeight(BufferView const & bv, VSpace const & vsp) void paintRow(BufferView const & bv, LyXText const & text, ParagraphList::iterator pit, RowList::iterator rit, int y_offset, int x_offset, int y) +{ + RowPainter painter(bv, text, pit, rit, y_offset, x_offset, y); + painter.paint(); +} + + +int paintRows(BufferView const & bv, LyXText const & text, + RowList::iterator rit, int xo, int y, int yf, int y2, int yo) { // fix up missing metrics() call for main LyXText // calling metrics() directly is (a) slow and (b) crashs @@ -1096,21 +1104,13 @@ void paintRow(BufferView const & bv, LyXText const & text, #endif } - RowPainter painter(bv, text, pit, rit, y_offset, x_offset, y); - painter.paint(); -} - - -int paintRows(BufferView const & bv, LyXText const & text, - RowList::iterator rit, int xo, int y, int yf, int y2, int yo) -{ + int yy = yf - y; RowList::iterator end = text.rows().end(); - while (rit != end && yf < y2) { + while (rit != end && yy + y < y2) { //const_cast(text).setHeightOfRow(rit); ParagraphList::iterator pit = text.getPar(rit); paintRow(bv, text, pit, rit, y + yo, xo, y + text.top_y()); y += rit->height(); - yf += rit->height(); ++rit; } return y;