* Splash screen code added by Angus Leeming
*/
-
#include <config.h>
#include "screen.h"
+
#include "lyxtext.h"
#include "lyxrc.h"
#include "lyxrow.h"
// 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);
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();
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;
+ }
+}
+
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);
// check for empty row
if (!rit_par->size()) {
- x = tmpx;
+ x = int(tmpx);
return 0;
}