]> git.lyx.org Git - features.git/commitdiff
move row loop for drawing from screen.C and insettext.C to rowpainter.C
authorAndré Pönitz <poenitz@gmx.net>
Mon, 28 Jul 2003 18:40:05 +0000 (18:40 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 28 Jul 2003 18:40:05 +0000 (18:40 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7423 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/screen.C
src/insets/insettext.C
src/rowpainter.C
src/rowpainter.h
src/text2.C

index 6a7c2b83a0967a1a596cea1a511e9ba2d63504b7..5b05f4e502352a3875b5b4577e9f01d210d7e4e5 100644 (file)
  * Splash screen code added by Angus Leeming
  */
 
-
 #include <config.h>
 
 #include "screen.h"
+
 #include "lyxtext.h"
 #include "lyxrc.h"
 #include "lyxrow.h"
@@ -465,16 +465,10 @@ void LyXScreen::drawFromTo(LyXText * text, BufferView * bv,
        // draw it
        RowList::iterator const rend = text->rows().end();
        int yf = y;
-       while (rit != rend && yf < y2) {
-               paintRows(*bv, *text, rit,
-                       y + yo, xo, y + topy);
-               y += rit->height();
-               yf += rit->height();
-               ++rit;
-       }
+       paintRows2(*bv, *text, rit, rend, xo, y, yf, y2, yo);
 
        // maybe we have to clear the screen at the bottom
-       if ((y < y2) && !text->isInInset()) {
+       if (y < y2 && !text->isInInset()) {
                workarea().getPainter().fillRectangle(0, y,
                        workarea().workWidth(), y2 - y,
                        LColor::bottomarea);
index 128065ebe6ffab1c21f174cf0c01a4af70ddc7aa..addaed18b4305f3502d8593f9d4797b78f1bf102 100644 (file)
@@ -364,14 +364,9 @@ void InsetText::draw(PainterInfo & pi, int x, int baseline) const
 
        int yf = y_offset + first;
        y = 0;
+       int yo = y_offset + first;
 
-       while (rit != end && yf < y2) {
-               paintRows(*bv, text_, rit,
-                       y + y_offset + first, x, y + text_.top_y());
-               y += rit->height();
-               yf += rit->height();
-               ++rit;
-       }
+       paintRows2(*bv, text_, rit, end, x, y, yf, y2, yo);
 
        text_.clearPaint();
 
index 4357cfb27199cda5014a3bd6354022cfe826dda5..52237e9af16b32221157a004e6874598c8a87d1c 100644 (file)
@@ -1092,3 +1092,17 @@ void paintRows(BufferView const & bv, LyXText const & text,
        RowPainter painter(bv, text, rit, y_offset, x_offset, y);
        painter.paint();
 }
+
+
+void paintRows2(BufferView const & bv, LyXText const & text,
+       RowList::iterator rit, RowList::iterator end,
+       int xo, int & y, int yf, int y2, int yo)
+{
+       while (rit != end && yf < y2) {
+               paintRows(bv, text, rit, y + yo, xo, y + text.top_y());
+               y += rit->height();
+               yf += rit->height();
+               ++rit;
+       }
+}
+
index 4d58ab5f041e261606d648b8e0ff3a183c692287..1dcc2474c78d5cdd7ea5c56115553eae5a9cf081 100644 (file)
@@ -21,9 +21,10 @@ class LyXText;
 class BufferView;
 class VSpace;
 
-/// initialise painter and paint the row
-void paintRows(BufferView const & bv, LyXText const & text,
-       RowList::iterator rit, int y_offset, int x_offset, int y);
+/// initialise painter and paint the rows
+void paintRows2(BufferView const & bv, LyXText const & text,
+       RowList::iterator rit, RowList::iterator end,
+       int xo, int & y, int yf, int y2, int yo);
 
 /// return the pixel height of a space marker before/after a par
 int getLengthMarkerHeight(BufferView const & bv, VSpace const & vsp);
index e5b7120953baa423189deb0f57f699aef4526792..1ce87ebd57b20a3c93c0557ac9fe532e9c9e8b23 100644 (file)
@@ -1738,7 +1738,7 @@ LyXText::getColumnNearX(RowList::iterator rit, int & x, bool & boundary) const
 
        // check for empty row
        if (!rit_par->size()) {
-               x = tmpx;
+               x = int(tmpx);
                return 0;
        }