3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
14 #include "rowpainter.h"
17 #include "coordcache.h"
20 #include "bufferparams.h"
21 #include "BufferView.h"
28 #include "lyxrow_funcs.h"
29 #include "metricsinfo.h"
30 #include "paragraph.h"
31 #include "paragraph_funcs.h"
32 #include "ParagraphParameters.h"
35 #include "frontends/font_metrics.h"
36 #include "frontends/nullpainter.h"
37 #include "frontends/Painter.h"
39 #include "insets/insettext.h"
41 #include "support/textutils.h"
43 #include <boost/crc.hpp>
57 * A class used for painting an individual row of text.
61 /// initialise and run painter
62 RowPainter(PainterInfo & pi, LyXText const & text,
63 pit_type pit, Row const & row, int x, int y);
65 // paint various parts
68 void paintChangeBar();
74 void paintForeignMark(double orig_x, LyXFont const & font, int desc = 0);
75 void paintHebrewComposeChar(lyx::pos_type & vpos, LyXFont const & font);
76 void paintArabicComposeChar(lyx::pos_type & vpos, LyXFont const & font);
77 void paintChars(lyx::pos_type & vpos, LyXFont font,
78 bool hebrew, bool arabic);
79 int paintAppendixStart(int y);
80 void paintFromPos(lyx::pos_type & vpos);
81 void paintInset(lyx::pos_type const pos, LyXFont const & font);
83 /// return left margin
84 int leftMargin() const;
86 /// return the label font for this row
87 LyXFont const getLabelFont() const;
89 /// bufferview to paint on
90 BufferView const & bv_;
95 /// LyXText for the row
96 LyXText const & text_;
97 ParagraphList const & pars_;
104 Paragraph const & par_;
106 /// is row erased? (change tracking)
111 int const yo_; // current baseline
120 RowPainter::RowPainter(PainterInfo & pi,
121 LyXText const & text, pit_type pit, Row const & row, int x, int y)
122 : bv_(*pi.base.bv), pain_(pi.pain), text_(text), pars_(text.paragraphs()),
123 row_(row), pit_(pit), par_(text.paragraphs()[pit]),
125 xo_(x), yo_(y), width_(text_.width())
127 RowMetrics m = text_.computeRowMetrics(pit, row_);
130 //lyxerr << "RowPainter: x: " << x_ << " xo: " << xo_ << " yo: " << yo_ << endl;
133 separator_ = m.separator;
135 label_hfill_ = m.label_hfill;
137 BOOST_ASSERT(pit >= 0);
138 BOOST_ASSERT(pit < int(text.paragraphs().size()));
142 LyXFont const RowPainter::getLabelFont() const
144 return text_.getLabelFont(par_);
148 int RowPainter::leftMargin() const
150 return text_.leftMargin(pit_, row_.pos());
154 void RowPainter::paintInset(pos_type const pos, LyXFont const & font)
156 InsetBase const * inset = par_.getInset(pos);
158 PainterInfo pi(const_cast<BufferView *>(&bv_), pain_);
159 // FIXME: We should always use font, see documentation of
160 // noFontChange() in insetbase.h.
161 pi.base.font = inset->noFontChange() ?
162 bv_.buffer()->params().getFont() :
164 pi.ltr_pos = (text_.bidi.level(pos) % 2 == 0);
165 pi.erased_ = erased_ || isDeletedText(par_, pos);
166 theCoords.insets().add(inset, int(x_), yo_);
167 InsetText const * const in = inset->asTextInset();
168 // non-wide insets are painted completely. Recursive
169 bool tmp = bv_.repaintAll();
170 if (!in || !in->Wide()) {
171 bv_.repaintAll(true);
172 lyxerr[Debug::PAINTING] << endl << "Paint inset fully" << endl;
174 if (bv_.repaintAll())
175 inset->drawSelection(pi, int(x_), yo_);
176 inset->draw(pi, int(x_), yo_);
178 x_ += inset->width();
182 void RowPainter::paintHebrewComposeChar(pos_type & vpos, LyXFont const & font)
184 pos_type pos = text_.bidi.vis2log(vpos);
189 char c = par_.getChar(pos);
193 int const width = font_metrics::width(c, font);
196 for (pos_type i = pos - 1; i >= 0; --i) {
198 if (!Encodings::IsComposeChar_hebrew(c)) {
199 if (IsPrintableNonspace(c)) {
201 text_.singleWidth(par_, i, c, text_.getFont(par_, i));
203 dx = (c == 'ø' || c == 'ã')
205 : (width2 - width) / 2;
212 pain_.text(int(x_) + dx, yo_, str, font);
216 void RowPainter::paintArabicComposeChar(pos_type & vpos, LyXFont const & font)
218 pos_type pos = text_.bidi.vis2log(vpos);
222 char c = par_.getChar(pos);
223 c = par_.transformChar(c, pos);
227 int const width = font_metrics::width(c, font);
230 for (pos_type i = pos - 1; i >= 0; --i) {
232 if (!Encodings::IsComposeChar_arabic(c)) {
233 if (IsPrintableNonspace(c)) {
235 text_.singleWidth(par_, i, c, text_.getFont(par_, i));
236 dx = (width2 - width) / 2;
242 pain_.text(int(x_) + dx, yo_, str, font);
246 void RowPainter::paintChars(pos_type & vpos, LyXFont font,
247 bool hebrew, bool arabic)
249 pos_type pos = text_.bidi.vis2log(vpos);
250 pos_type const end = row_.endpos();
251 FontSpan const font_span = par_.fontSpan(pos);
252 Change::Type const prev_change = par_.lookupChange(pos);
256 str += par_.getChar(pos);
258 unsigned char c = str[0];
259 str[0] = par_.transformChar(c, pos);
262 // collect as much similar chars as we can
263 for (++vpos ; vpos < end ; ++vpos) {
264 pos = text_.bidi.vis2log(vpos);
265 if (pos < font_span.first || pos > font_span.last)
268 if (prev_change != par_.lookupChange(pos))
271 char c = par_.getChar(pos);
273 if (!IsPrintableNonspace(c))
276 if (arabic && Encodings::IsComposeChar_arabic(c))
279 if (hebrew && Encodings::IsComposeChar_hebrew(c))
283 c = par_.transformChar(c, pos);
288 if (prev_change == Change::DELETED)
289 font.setColor(LColor::strikeout);
290 else if (prev_change == Change::INSERTED)
291 font.setColor(LColor::newtext);
293 // Draw text and set the new x position
294 //lyxerr << "paint row: yo_ " << yo_ << "\n";
295 pain_.text(int(x_), yo_, str, font);
296 x_ += font_metrics::width(str, font);
300 void RowPainter::paintForeignMark(double orig_x, LyXFont const & font, int desc)
302 if (!lyxrc.mark_foreign_language)
304 if (font.language() == latex_language)
306 if (font.language() == bv_.buffer()->params().language)
309 int const y = yo_ + 1 + desc;
310 pain_.line(int(orig_x), y, int(x_), y, LColor::language);
314 void RowPainter::paintFromPos(pos_type & vpos)
316 pos_type const pos = text_.bidi.vis2log(vpos);
317 LyXFont orig_font = text_.getFont(par_, pos);
319 double const orig_x = x_;
321 if (par_.isInset(pos)) {
322 paintInset(pos, orig_font);
324 paintForeignMark(orig_x, orig_font,
325 par_.getInset(pos)->descent());
329 // usual characters, no insets
330 char const c = par_.getChar(pos);
332 // special case languages
333 std::string const & lang = orig_font.language()->lang();
334 bool const hebrew = lang == "hebrew";
335 bool const arabic = lang == "arabic" &&
336 (lyxrc.font_norm_type == LyXRC::ISO_8859_6_8 ||
337 lyxrc.font_norm_type == LyXRC::ISO_10646_1);
339 // draw as many chars as we can
340 if ((!hebrew && !arabic)
341 || (hebrew && !Encodings::IsComposeChar_hebrew(c))
342 || (arabic && !Encodings::IsComposeChar_arabic(c))) {
343 paintChars(vpos, orig_font, hebrew, arabic);
345 paintHebrewComposeChar(vpos, orig_font);
347 paintArabicComposeChar(vpos, orig_font);
350 paintForeignMark(orig_x, orig_font);
354 void RowPainter::paintChangeBar()
356 pos_type const start = row_.pos();
357 pos_type const end = row_.endpos();
359 if (start == end || !par_.isChanged(start, end))
362 int const height = text_.isLastRow(pit_, row_)
366 pain_.fillRectangle(4, yo_ - row_.ascent(), 5, height, LColor::changebar);
370 void RowPainter::paintAppendix()
372 if (!par_.params().appendix())
375 int y = yo_ - row_.ascent();
377 if (par_.params().startOfAppendix())
378 y += 2 * defaultRowHeight();
380 pain_.line(1, y, 1, yo_ + row_.height(), LColor::appendix);
381 pain_.line(width_ - 2, y, width_ - 2, yo_ + row_.height(), LColor::appendix);
385 void RowPainter::paintDepthBar()
387 Paragraph::depth_type const depth = par_.getDepth();
392 Paragraph::depth_type prev_depth = 0;
393 if (!text_.isFirstRow(pit_, row_)) {
394 pit_type pit2 = pit_;
397 prev_depth = pars_[pit2].getDepth();
400 Paragraph::depth_type next_depth = 0;
401 if (!text_.isLastRow(pit_, row_)) {
402 pit_type pit2 = pit_;
403 if (row_.endpos() >= pars_[pit2].size())
405 next_depth = pars_[pit2].getDepth();
408 for (Paragraph::depth_type i = 1; i <= depth; ++i) {
409 int const w = nestMargin() / 5;
410 int x = int(xo_) + w * i;
411 // only consider the changebar space if we're drawing outermost text
412 if (text_.isMainText())
413 x += changebarMargin();
415 int const starty = yo_ - row_.ascent();
416 int const h = row_.height() - 1 - (i - next_depth - 1) * 3;
418 pain_.line(x, starty, x, starty + h, LColor::depthbar);
421 pain_.fillRectangle(x, starty, w, 2, LColor::depthbar);
423 pain_.fillRectangle(x, starty + h, w, 2, LColor::depthbar);
428 int RowPainter::paintAppendixStart(int y)
431 pb_font.setColor(LColor::appendix);
434 string const label = _("Appendix");
438 font_metrics::rectText(label, pb_font, w, a, d);
440 int const text_start = int(xo_ + (width_ - w) / 2);
441 int const text_end = text_start + w;
443 pain_.rectText(text_start, y + d, label, pb_font, LColor::none, LColor::none);
445 pain_.line(int(xo_ + 1), y, text_start, y, LColor::appendix);
446 pain_.line(text_end, y, int(xo_ + width_ - 2), y, LColor::appendix);
448 return 3 * defaultRowHeight();
452 void RowPainter::paintFirst()
454 ParagraphParameters const & parparams = par_.params();
458 // start of appendix?
459 if (parparams.startOfAppendix())
460 y_top += paintAppendixStart(yo_ - row_.ascent() + 2 * defaultRowHeight());
462 Buffer const & buffer = *bv_.buffer();
464 LyXLayout_ptr const & layout = par_.layout();
466 if (buffer.params().paragraph_separation == BufferParams::PARSEP_SKIP) {
468 if (layout->latextype == LATEX_PARAGRAPH
469 && !par_.getDepth()) {
470 y_top += buffer.params().getDefSkip().inPixels(bv_);
472 LyXLayout_ptr const & playout = pars_[pit_ - 1].layout();
473 if (playout->latextype == LATEX_PARAGRAPH
474 && !pars_[pit_ - 1].getDepth()) {
475 // is it right to use defskip here, too? (AS)
476 y_top += buffer.params().getDefSkip().inPixels(bv_);
482 bool const is_rtl = text_.isRTL(par_);
483 bool const is_seq = isFirstInSequence(pit_, text_.paragraphs());
484 //lyxerr << "paintFirst: " << par_.id() << " is_seq: " << is_seq << std::endl;
486 // should we print a label?
487 if (layout->labeltype >= LABEL_STATIC
488 && (layout->labeltype != LABEL_STATIC
489 || layout->latextype != LATEX_ENVIRONMENT
492 LyXFont const font = getLabelFont();
493 string const str = par_.getLabelstring();
497 // this is special code for the chapter layout. This is
498 // printed in an extra row and has a pagebreak at
500 if (layout->counter == "chapter") {
501 double spacing_val = 1.0;
502 if (!parparams.spacing().isDefault()) {
503 spacing_val = parparams.spacing().getValue();
505 spacing_val = buffer.params().spacing().getValue();
508 int const labeladdon = int(font_metrics::maxHeight(font) * layout->spacing.getValue() * spacing_val);
510 int const maxdesc = int(font_metrics::maxDescent(font) * layout->spacing.getValue() * spacing_val)
511 + int(layout->parsep) * defaultRowHeight();
514 x = width_ - leftMargin() -
515 font_metrics::width(str, font);
518 pain_.text(int(x), yo_ - maxdesc - labeladdon, str, font);
521 x = width_ - leftMargin()
522 + font_metrics::width(layout->labelsep, font);
524 x = x_ - font_metrics::width(layout->labelsep, font)
525 - font_metrics::width(str, font);
528 pain_.text(int(x), yo_, str, font);
532 // the labels at the top of an environment.
533 // More or less for bibliography
535 (layout->labeltype == LABEL_TOP_ENVIRONMENT ||
536 layout->labeltype == LABEL_BIBLIO ||
537 layout->labeltype == LABEL_CENTERED_TOP_ENVIRONMENT)) {
538 LyXFont font = getLabelFont();
539 if (!par_.getLabelstring().empty()) {
540 string const str = par_.getLabelstring();
541 double spacing_val = 1.0;
542 if (!parparams.spacing().isDefault())
543 spacing_val = parparams.spacing().getValue();
545 spacing_val = buffer.params().spacing().getValue();
547 int const labeladdon = int(font_metrics::maxHeight(font) * layout->spacing.getValue() * spacing_val);
550 int(font_metrics::maxDescent(font) * layout->spacing.getValue() * spacing_val
551 + (layout->labelbottomsep * defaultRowHeight()));
554 if (layout->labeltype == LABEL_CENTERED_TOP_ENVIRONMENT) {
557 x += (width_ - text_.rightMargin(par_) - leftMargin()) / 2;
558 x -= font_metrics::width(str, font) / 2;
560 x = width_ - leftMargin() -
561 font_metrics::width(str, font);
563 pain_.text(int(x), yo_ - maxdesc - labeladdon, str, font);
569 void RowPainter::paintLast()
571 bool const is_rtl = text_.isRTL(par_);
572 int const endlabel = getEndLabel(pit_, text_.paragraphs());
577 case END_LABEL_FILLED_BOX: {
578 LyXFont const font = getLabelFont();
579 int const size = int(0.75 * font_metrics::maxAscent(font));
580 int const y = yo_ - size;
581 int x = is_rtl ? nestMargin() + changebarMargin() : width_ - size;
583 if (width_ - int(row_.width()) <= size)
584 x += (size - width_ + row_.width() + 1) * (is_rtl ? -1 : 1);
586 if (endlabel == END_LABEL_BOX)
587 pain_.rectangle(x, y, size, size, LColor::eolmarker);
589 pain_.fillRectangle(x, y, size, size, LColor::eolmarker);
593 case END_LABEL_STATIC: {
594 LyXFont font = getLabelFont();
595 string const & str = par_.layout()->endlabelstring();
596 double const x = is_rtl ?
597 x_ - font_metrics::width(str, font)
598 : - text_.rightMargin(par_) - row_.width();
599 pain_.text(int(x), yo_, str, font);
603 case END_LABEL_NO_LABEL:
609 void RowPainter::paintText()
611 pos_type const end = row_.endpos();
612 pos_type body_pos = par_.beginOfBody();
614 (body_pos > end || !par_.isLineSeparator(body_pos - 1))) {
618 LyXLayout_ptr const & layout = par_.layout();
620 bool running_strikeout = false;
621 bool is_struckout = false;
622 int last_strikeout_x = 0;
624 // Use font span to speed things up, see below
628 for (pos_type vpos = row_.pos(); vpos < end; ) {
629 if (x_ > bv_.workWidth())
632 pos_type const pos = text_.bidi.vis2log(vpos);
634 if (pos >= par_.size()) {
639 // Use font span to speed things up, see above
640 if (vpos < font_span.first || vpos > font_span.last) {
641 font_span = par_.fontSpan(vpos);
642 font = text_.getFont(par_, vpos);
645 const int width_pos =
646 text_.singleWidth(par_, pos, par_.getChar(pos), font);
648 if (x_ + width_pos < 0) {
654 is_struckout = isDeletedText(par_, pos);
656 if (is_struckout && !running_strikeout) {
657 running_strikeout = true;
658 last_strikeout_x = int(x_);
661 bool const highly_editable_inset = par_.isInset(pos)
662 && isHighlyEditableInset(par_.getInset(pos));
664 // If we reach the end of a struck out range, paint it.
665 // We also don't paint across things like tables
666 if (running_strikeout && (highly_editable_inset || !is_struckout)) {
667 // Calculate 1/3 height of the buffer's default font
670 font_metrics::maxAscent(bv_.buffer()->params().getFont()) / 3;
671 pain_.line(last_strikeout_x, middle, int(x_), middle,
672 LColor::strikeout, Painter::line_solid, Painter::line_thin);
673 running_strikeout = false;
676 if (body_pos > 0 && pos == body_pos - 1) {
677 int const lwidth = font_metrics::width(layout->labelsep,
680 x_ += label_hfill_ + lwidth - width_pos;
683 if (par_.isHfill(pos)) {
687 int const y1 = y0 - defaultRowHeight() / 2;
689 pain_.line(int(x_), y1, int(x_), y0, LColor::added_space);
691 if (hfillExpansion(par_, row_, pos)) {
692 int const y2 = (y0 + y1) / 2;
694 if (pos >= body_pos) {
695 pain_.line(int(x_), y2, int(x_ + hfill_), y2,
697 Painter::line_onoffdash);
700 pain_.line(int(x_), y2, int(x_ + label_hfill_), y2,
702 Painter::line_onoffdash);
705 pain_.line(int(x_), y1, int(x_), y0, LColor::added_space);
709 } else if (par_.isSeparator(pos)) {
719 // if we reach the end of a struck out range, paint it
720 if (running_strikeout) {
721 // calculate 1/3 height of the buffer's default font
724 font_metrics::maxAscent(bv_.buffer()->params().getFont()) / 3;
725 pain_.line(last_strikeout_x, middle, int(x_), middle,
726 LColor::strikeout, Painter::line_solid, Painter::line_thin);
727 running_strikeout = false;
732 lyx::size_type calculateRowSignature(Row const & row, Paragraph const & par,
735 boost::crc_32_type crc;
736 for (lyx::pos_type i = row.pos(); i < row.endpos(); ++i) {
737 const unsigned char b[] = { par.getChar(i) };
738 crc.process_bytes(b, 1);
740 const unsigned char b[] = { x, y, row.width() };
741 crc.process_bytes(b, 3);
742 return crc.checksum();
746 bool CursorOnRow(PainterInfo & pi, pit_type const pit,
747 RowList::const_iterator rit, LyXText const & text)
749 // Is there a cursor on this row (or inside inset on row)
750 LCursor & cur = pi.base.bv->cursor();
751 for (lyx::size_type d = 0; d < cur.depth(); d++) {
752 CursorSlice const & sl = cur[d];
753 if (sl.text() == &text
755 && sl.pos() >= rit->pos()
756 && sl.pos() <= rit->endpos())
763 bool innerCursorOnRow(PainterInfo & pi, pit_type pit,
764 RowList::const_iterator rit, LyXText const & text)
766 // Is there a cursor inside an inset on this row, and is this inset
767 // the only "character" on this row
768 LCursor & cur = pi.base.bv->cursor();
769 if (rit->pos() + 1 != rit->endpos())
771 for (lyx::size_type d = 0; d < cur.depth(); d++) {
772 CursorSlice const & sl = cur[d];
773 if (sl.text() == &text
775 && sl.pos() == rit->pos())
776 return d < cur.depth() - 1;
783 (PainterInfo & pi, LyXText const & text, pit_type pit, int x, int y,
786 // lyxerr << " paintPar: pit: " << pit << " at y: " << y << endl;
787 static NullPainter nop;
788 static PainterInfo nullpi(pi.base.bv, nop);
789 int const ww = pi.base.bv->workHeight();
791 Paragraph const & par = text.paragraphs()[pit];
793 RowList::const_iterator const rb = par.rows().begin();
794 RowList::const_iterator const re = par.rows().end();
795 theCoords.parPos()[&text][pit] = Point(x, y);
798 lyx::size_type rowno(0);
799 for (RowList::const_iterator rit = rb; rit != re; ++rit, ++rowno) {
801 // Allow setting of bv->repaintAll() for nested insets in
803 bool tmp = pi.base.bv->repaintAll();
805 // Row signature; has row changed since last paint?
806 lyx::size_type const row_sig = calculateRowSignature(*rit, par, x, y);
807 bool row_has_changed = par.rowSignature()[rowno] != row_sig;
809 bool cursor_on_row = CursorOnRow(pi, pit, rit, text);
810 bool in_inset_alone_on_row = innerCursorOnRow(pi, pit, rit,
813 // If this is the only object on the row, we can make it wide
814 for (pos_type i = rit->pos() ; i != rit->endpos(); ++i) {
815 InsetBase const * const in = par.getInset(i);
817 InsetText const * const t = in->asTextInset();
819 t->Wide() = in_inset_alone_on_row &&
824 // If selection is on, the current row signature differs
825 // from cache, or cursor is inside an inset _on this row_,
826 // then paint the row
827 if (repaintAll || row_has_changed || cursor_on_row) {
828 // Add to row signature cache
829 par.rowSignature()[rowno] = row_sig;
831 bool const inside = (y + rit->descent() >= 0
832 && y - rit->ascent() < ww);
833 RowPainter rp(inside ? pi : nullpi, text, pit, *rit, x, y);
834 // Clear background of this row
835 // (if paragraph background was not cleared)
837 (!in_inset_alone_on_row || row_has_changed)) {
838 pi.pain.fillRectangle(( rowno ? 0 : x - 10 ), y - rit->ascent(),
839 pi.base.bv->workWidth(), rit->height(),
840 text.backgroundColor());
841 // If outer row has changed, force nested
842 // insets to repaint completely
844 pi.base.bv->repaintAll(true);
847 // Instrumentation for testing row cache (see also
849 if (text.isMainText())
850 lyxerr[Debug::PAINTING] << "#";
852 lyxerr[Debug::PAINTING] << "[" <<
853 repaintAll << row_has_changed <<
854 cursor_on_row << "]";
865 // Restore, see above
866 pi.base.bv->repaintAll(tmp);
868 lyxerr[Debug::PAINTING] << "." << endl;
874 void paintText(BufferView const & bv, ViewMetricsInfo const & vi)
876 Painter & pain = bv.painter();
877 LyXText * const text = bv.text();
878 bool const select = bv.cursor().selection();
880 PainterInfo pi(const_cast<BufferView *>(&bv), pain);
881 // Should the whole screen, including insets, be refreshed?
882 bool repaintAll(select || !vi.singlepar);
885 // Clear background (if not delegated to rows)
886 pain.fillRectangle(0, vi.y1, bv.workWidth(), vi.y2 - vi.y1,
887 text->backgroundColor());
890 text->drawSelection(pi, 0, 0);
895 for (pit_type pit = vi.p1; pit <= vi.p2; ++pit) {
896 bv.repaintAll(repaintAll);
897 Paragraph const & par = text->getPar(pit);
899 paintPar(pi, *bv.text(), pit, 0, yy, repaintAll);
903 // Cache one paragraph above and one below
904 // Note MV: this cannot be suppressed even for singlepar.
905 // Try viewing the User Guide Mobius figure
908 text->redoParagraph(vi.p1 - 1);
909 theCoords.parPos()[bv.text()][vi.p1 - 1] =
910 Point(0, vi.y1 - text->getPar(vi.p1 - 1).descent());
913 if (vi.p2 < lyx::pit_type(text->paragraphs().size()) - 1) {
914 text->redoParagraph(vi.p2 + 1);
915 theCoords.parPos()[bv.text()][vi.p2 + 1] =
916 Point(0, vi.y2 + text->getPar(vi.p2 + 1).ascent());
919 // and grey out above (should not happen later)
920 // lyxerr << "par ascent: " << text->getPar(vi.p1).ascent() << endl;
921 if (vi.y1 > 0 && !vi.singlepar)
922 pain.fillRectangle(0, 0, bv.workWidth(), vi.y1, LColor::bottomarea);
924 // and possibly grey out below
925 // lyxerr << "par descent: " << text->getPar(vi.p1).ascent() << endl;
926 if (vi.y2 < bv.workHeight() && !vi.singlepar)
927 pain.fillRectangle(0, vi.y2, bv.workWidth(), bv.workHeight() - vi.y2, LColor::bottomarea);
931 void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y)
933 // lyxerr << " paintTextInset: y: " << y << endl;
935 y -= text.getPar(0).ascent();
936 // This flag can not be set from within same inset:
937 bool repaintAll = pi.base.bv->repaintAll();
938 for (int pit = 0; pit < int(text.paragraphs().size()); ++pit) {
939 y += text.getPar(pit).ascent();
940 paintPar(pi, text, pit, x, y, repaintAll);
941 y += text.getPar(pit).descent();