-
-
-void LyXScreen::drawFromTo(LyXText * text, BufferView * bv,
- int y1, int y2, int yo, int xo,
- bool internal)
-{
- lyxerr[Debug::GUI] << "screen: drawFromTo " << y1 << '-' << y2 << endl;
-
- int y_text = text->top_y() + y1;
-
- // get the first needed row
- Row * row = text->getRowNearY(y_text);
- // y_text is now the real beginning of the row
-
- int y = y_text - text->top_y();
- // y1 is now the real beginning of row on the screen
-
-
- while (row != 0 && y < y2) {
- LyXText::text_status st = text->status();
- // we need this here as the row pointer may be illegal
- // at a later time (Jug20020502)
- Row * prev = row->previous();
- RowPainter rp(*bv, *text, *row);
-
- if (rp.paint(y + yo, xo, y + text->top_y()))
- text->markChangeInDraw(bv, row, prev);
-
- internal = internal && (st != LyXText::CHANGED_IN_DRAW);
- while (internal && text->status() == LyXText::CHANGED_IN_DRAW) {
- text->fullRebreak(bv);
- st = LyXText::NEED_MORE_REFRESH;
- text->setCursor(bv, text->cursor.par(), text->cursor.pos());
- text->status(bv, st);
- Row * prev = row->previous();
- RowPainter rp(*bv, *text, *row);
- if (rp.paint(y + yo, xo, y + text->top_y()))
- text->markChangeInDraw(bv, row, prev);
- }
- y += row->height();
- row = row->next();
- }
- force_clear_ = false;
-
- // maybe we have to clear the screen at the bottom
- if ((y < y2) && text->isTopLevel()) {
- workarea().getPainter().fillRectangle(0, y,
- workarea().workWidth(), y2 - y,
- LColor::bottomarea);
- }
-}
-
-
-void LyXScreen::drawOneRow(LyXText * text, BufferView * bv, Row * row,
- int y_text, int yo, int xo)
-{
- int const y = y_text - text->top_y() + yo;
-
- if (((y + row->height()) > 0) &&
- ((y - row->height()) <= static_cast<int>(workarea().workHeight()))) {
- Row * prev = row->previous();
- RowPainter rp(*bv, *text, *row);
- if (rp.paint(y, xo, y + text->top_y()))
- text->markChangeInDraw(bv, row, prev);
- }
- force_clear_ = false;
-}