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 "metricsinfo.h"
29 #include "paragraph.h"
30 #include "paragraph_funcs.h"
31 #include "ParagraphParameters.h"
34 #include "frontends/FontMetrics.h"
35 #include "frontends/Painter.h"
37 #include "insets/insettext.h"
39 #include "support/textutils.h"
41 #include <boost/crc.hpp>
46 using frontend::Painter;
47 using frontend::FontMetrics;
57 /// Flag: do a full redraw of inside text of inset
58 /// Working variable indicating a full screen refresh
62 * A class used for painting an individual row of text.
66 /// initialise and run painter
67 RowPainter(PainterInfo & pi, LyXText const & text,
68 pit_type pit, Row const & row, int x, int y);
70 // paint various parts
73 void paintChangeBar();
79 void paintForeignMark(double orig_x, LyXFont const & font, int desc = 0);
80 void paintHebrewComposeChar(pos_type & vpos, LyXFont const & font);
81 void paintArabicComposeChar(pos_type & vpos, LyXFont const & font);
82 void paintChars(pos_type & vpos, LyXFont font,
83 bool hebrew, bool arabic);
84 int paintAppendixStart(int y);
85 void paintFromPos(pos_type & vpos);
86 void paintInset(pos_type const pos, LyXFont const & font);
88 /// return left margin
89 int leftMargin() const;
91 /// return the label font for this row
92 LyXFont const getLabelFont() const;
94 /// bufferview to paint on
100 /// LyXText for the row
101 LyXText const & text_;
102 ParagraphList const & pars_;
109 Paragraph const & par_;
111 /// is row erased? (change tracking)
116 int const yo_; // current baseline
125 RowPainter::RowPainter(PainterInfo & pi,
126 LyXText const & text, pit_type pit, Row const & row, int x, int y)
127 : bv_(*pi.base.bv), pain_(pi.pain), text_(text), pars_(text.paragraphs()),
128 row_(row), pit_(pit), par_(text.paragraphs()[pit]),
130 xo_(x), yo_(y), width_(text_.width())
132 RowMetrics m = text_.computeRowMetrics(pit, row_);
135 //lyxerr << "RowPainter: x: " << x_ << " xo: " << xo_ << " yo: " << yo_ << endl;
138 separator_ = m.separator;
140 label_hfill_ = m.label_hfill;
142 BOOST_ASSERT(pit >= 0);
143 BOOST_ASSERT(pit < int(text.paragraphs().size()));
147 LyXFont const RowPainter::getLabelFont() const
149 return text_.getLabelFont(par_);
153 int RowPainter::leftMargin() const
155 return text_.leftMargin(pit_, row_.pos());
159 void RowPainter::paintInset(pos_type const pos, LyXFont const & font)
161 InsetBase const * inset = par_.getInset(pos);
163 PainterInfo pi(const_cast<BufferView *>(&bv_), pain_);
164 // FIXME: We should always use font, see documentation of
165 // noFontChange() in insetbase.h.
166 pi.base.font = inset->noFontChange() ?
167 bv_.buffer()->params().getFont() :
169 pi.ltr_pos = (text_.bidi.level(pos) % 2 == 0);
170 pi.erased_ = erased_ || par_.isDeleted(pos);
171 bv_.coordCache().insets().add(inset, int(x_), yo_);
172 InsetText const * const in = inset->asTextInset();
173 // non-wide insets are painted completely. Recursive
174 bool tmp = refreshInside;
175 if (!in || !in->Wide()) {
176 refreshInside = true;
177 lyxerr[Debug::PAINTING] << endl << "Paint inset fully" << endl;
180 inset->drawSelection(pi, int(x_), yo_);
181 inset->draw(pi, int(x_), yo_);
183 x_ += inset->width();
187 void RowPainter::paintHebrewComposeChar(pos_type & vpos, LyXFont const & font)
189 pos_type pos = text_.bidi.vis2log(vpos);
194 char_type c = par_.getChar(pos);
198 int const width = theFontMetrics(font).width(c);
201 for (pos_type i = pos - 1; i >= 0; --i) {
203 if (!Encodings::isComposeChar_hebrew(c)) {
204 if (isPrintableNonspace(c)) {
206 text_.singleWidth(par_, i, c, text_.getFont(par_, i));
208 // This does not work anymore, and non-ascii
209 // characters in source files are forbidden
212 dx = (c == 'ø' || c == 'ã')
214 : (width2 - width) / 2;
222 pain_.text(int(x_) + dx, yo_, str, font);
226 void RowPainter::paintArabicComposeChar(pos_type & vpos, LyXFont const & font)
228 pos_type pos = text_.bidi.vis2log(vpos);
232 char_type c = par_.getChar(pos);
233 c = par_.transformChar(c, pos);
237 int const width = theFontMetrics(font).width(c);
240 for (pos_type i = pos - 1; i >= 0; --i) {
242 if (!Encodings::isComposeChar_arabic(c)) {
243 if (isPrintableNonspace(c)) {
245 text_.singleWidth(par_, i, c, text_.getFont(par_, i));
246 dx = (width2 - width) / 2;
252 pain_.text(int(x_) + dx, yo_, str, font);
256 void RowPainter::paintChars(pos_type & vpos, LyXFont font,
257 bool hebrew, bool arabic)
259 pos_type pos = text_.bidi.vis2log(vpos);
260 pos_type const end = row_.endpos();
261 FontSpan const font_span = par_.fontSpan(pos);
262 Change::Type const prev_change = par_.lookupChange(pos).type;
267 str += par_.getChar(pos);
269 std::vector<char_type> str;
270 str.push_back(par_.getChar(pos));
273 char_type c = str[0];
274 str[0] = par_.transformChar(c, pos);
277 // collect as much similar chars as we can
278 for (++vpos ; vpos < end ; ++vpos) {
279 pos = text_.bidi.vis2log(vpos);
280 if (pos < font_span.first || pos > font_span.last)
283 if (prev_change != par_.lookupChange(pos).type)
286 char_type c = par_.getChar(pos);
288 if (!isPrintableNonspace(c))
291 if (arabic && Encodings::isComposeChar_arabic(c))
294 if (hebrew && Encodings::isComposeChar_hebrew(c))
298 c = par_.transformChar(c, pos);
307 if (prev_change == Change::DELETED)
308 font.setColor(LColor::strikeout);
309 else if (prev_change == Change::INSERTED)
310 font.setColor(LColor::newtext);
312 // Draw text and set the new x position
313 //lyxerr << "paint row: yo_ " << yo_ << "\n";
315 int width = pain_.text(int(x_), yo_, str, font);
317 int width = pain_.text(int(x_), yo_, &str[0], str.size(), font);
323 void RowPainter::paintForeignMark(double orig_x, LyXFont const & font, int desc)
325 if (!lyxrc.mark_foreign_language)
327 if (font.language() == latex_language)
329 if (font.language() == bv_.buffer()->params().language)
332 int const y = yo_ + 1 + desc;
333 pain_.line(int(orig_x), y, int(x_), y, LColor::language);
337 void RowPainter::paintFromPos(pos_type & vpos)
339 pos_type const pos = text_.bidi.vis2log(vpos);
340 LyXFont orig_font = text_.getFont(par_, pos);
342 double const orig_x = x_;
344 if (par_.isInset(pos)) {
345 paintInset(pos, orig_font);
347 paintForeignMark(orig_x, orig_font,
348 par_.getInset(pos)->descent());
352 // usual characters, no insets
353 char_type const c = par_.getChar(pos);
355 // special case languages
356 std::string const & lang = orig_font.language()->lang();
357 bool const hebrew = lang == "hebrew";
358 bool const arabic = lang == "arabic" &&
359 (lyxrc.font_norm_type == LyXRC::ISO_8859_6_8 ||
360 lyxrc.font_norm_type == LyXRC::ISO_10646_1);
362 // draw as many chars as we can
363 if ((!hebrew && !arabic)
364 || (hebrew && !Encodings::isComposeChar_hebrew(c))
365 || (arabic && !Encodings::isComposeChar_arabic(c))) {
366 paintChars(vpos, orig_font, hebrew, arabic);
368 paintHebrewComposeChar(vpos, orig_font);
370 paintArabicComposeChar(vpos, orig_font);
373 paintForeignMark(orig_x, orig_font);
377 void RowPainter::paintChangeBar()
379 pos_type const start = row_.pos();
380 pos_type const end = row_.endpos();
382 if (start == end || !par_.isChanged(start, end))
385 int const height = text_.isLastRow(pit_, row_)
389 pain_.fillRectangle(5, yo_ - row_.ascent(), 3, height, LColor::changebar);
393 void RowPainter::paintAppendix()
395 if (!par_.params().appendix())
398 int y = yo_ - row_.ascent();
400 if (par_.params().startOfAppendix())
401 y += 2 * defaultRowHeight();
403 pain_.line(1, y, 1, yo_ + row_.height(), LColor::appendix);
404 pain_.line(width_ - 2, y, width_ - 2, yo_ + row_.height(), LColor::appendix);
408 void RowPainter::paintDepthBar()
410 depth_type const depth = par_.getDepth();
415 depth_type prev_depth = 0;
416 if (!text_.isFirstRow(pit_, row_)) {
417 pit_type pit2 = pit_;
420 prev_depth = pars_[pit2].getDepth();
423 depth_type next_depth = 0;
424 if (!text_.isLastRow(pit_, row_)) {
425 pit_type pit2 = pit_;
426 if (row_.endpos() >= pars_[pit2].size())
428 next_depth = pars_[pit2].getDepth();
431 for (depth_type i = 1; i <= depth; ++i) {
432 int const w = nestMargin() / 5;
433 int x = int(xo_) + w * i;
434 // only consider the changebar space if we're drawing outermost text
435 if (text_.isMainText())
436 x += changebarMargin();
438 int const starty = yo_ - row_.ascent();
439 int const h = row_.height() - 1 - (i - next_depth - 1) * 3;
441 pain_.line(x, starty, x, starty + h, LColor::depthbar);
444 pain_.fillRectangle(x, starty, w, 2, LColor::depthbar);
446 pain_.fillRectangle(x, starty + h, w, 2, LColor::depthbar);
451 int RowPainter::paintAppendixStart(int y)
454 pb_font.setColor(LColor::appendix);
461 docstring const label = _("Appendix");
462 theFontMetrics(pb_font).rectText(label, w, a, d);
464 int const text_start = int(xo_ + (width_ - w) / 2);
465 int const text_end = text_start + w;
467 pain_.rectText(text_start, y + d, label, pb_font, LColor::none, LColor::none);
469 pain_.line(int(xo_ + 1), y, text_start, y, LColor::appendix);
470 pain_.line(text_end, y, int(xo_ + width_ - 2), y, LColor::appendix);
472 return 3 * defaultRowHeight();
476 void RowPainter::paintFirst()
478 ParagraphParameters const & parparams = par_.params();
482 // start of appendix?
483 if (parparams.startOfAppendix())
484 y_top += paintAppendixStart(yo_ - row_.ascent() + 2 * defaultRowHeight());
486 Buffer const & buffer = *bv_.buffer();
488 LyXLayout_ptr const & layout = par_.layout();
490 if (buffer.params().paragraph_separation == BufferParams::PARSEP_SKIP) {
492 if (layout->latextype == LATEX_PARAGRAPH
493 && !par_.getDepth()) {
494 y_top += buffer.params().getDefSkip().inPixels(bv_);
496 LyXLayout_ptr const & playout = pars_[pit_ - 1].layout();
497 if (playout->latextype == LATEX_PARAGRAPH
498 && !pars_[pit_ - 1].getDepth()) {
499 // is it right to use defskip here, too? (AS)
500 y_top += buffer.params().getDefSkip().inPixels(bv_);
506 bool const is_rtl = text_.isRTL(par_);
507 bool const is_seq = isFirstInSequence(pit_, text_.paragraphs());
508 //lyxerr << "paintFirst: " << par_.id() << " is_seq: " << is_seq << std::endl;
510 // should we print a label?
511 if (layout->labeltype >= LABEL_STATIC
512 && (layout->labeltype != LABEL_STATIC
513 || layout->latextype != LATEX_ENVIRONMENT
516 LyXFont const font = getLabelFont();
517 FontMetrics const & fm = theFontMetrics(font);
519 docstring const str = par_.getLabelstring();
523 // this is special code for the chapter layout. This is
524 // printed in an extra row and has a pagebreak at
526 if (layout->counter == "chapter") {
527 double spacing_val = 1.0;
528 if (!parparams.spacing().isDefault()) {
529 spacing_val = parparams.spacing().getValue();
531 spacing_val = buffer.params().spacing().getValue();
534 int const labeladdon = int(fm.maxHeight() * layout->spacing.getValue() * spacing_val);
536 int const maxdesc = int(fm.maxDescent() * layout->spacing.getValue() * spacing_val)
537 + int(layout->parsep) * defaultRowHeight();
540 x = width_ - leftMargin() -
544 pain_.text(int(x), yo_ - maxdesc - labeladdon, str, font);
547 docstring lab = from_utf8(layout->labelsep);
549 x = width_ - leftMargin()
552 x = x_ - fm.width(lab)
556 pain_.text(int(x), yo_, str, font);
560 // the labels at the top of an environment.
561 // More or less for bibliography
563 (layout->labeltype == LABEL_TOP_ENVIRONMENT ||
564 layout->labeltype == LABEL_BIBLIO ||
565 layout->labeltype == LABEL_CENTERED_TOP_ENVIRONMENT)) {
566 LyXFont font = getLabelFont();
567 if (!par_.getLabelstring().empty()) {
568 docstring const str = par_.getLabelstring();
569 double spacing_val = 1.0;
570 if (!parparams.spacing().isDefault())
571 spacing_val = parparams.spacing().getValue();
573 spacing_val = buffer.params().spacing().getValue();
575 FontMetrics const & fm = theFontMetrics(font);
577 int const labeladdon = int(fm.maxHeight()
578 * layout->spacing.getValue() * spacing_val);
581 int(fm.maxDescent() * layout->spacing.getValue() * spacing_val
582 + (layout->labelbottomsep * defaultRowHeight()));
585 if (layout->labeltype == LABEL_CENTERED_TOP_ENVIRONMENT) {
588 x += (width_ - text_.rightMargin(par_) - leftMargin()) / 2;
589 x -= fm.width(str) / 2;
591 x = width_ - leftMargin() - fm.width(str);
593 pain_.text(int(x), yo_ - maxdesc - labeladdon, str, font);
599 void RowPainter::paintLast()
601 bool const is_rtl = text_.isRTL(par_);
602 int const endlabel = getEndLabel(pit_, text_.paragraphs());
607 case END_LABEL_FILLED_BOX: {
608 LyXFont const font = getLabelFont();
609 FontMetrics const & fm = theFontMetrics(font);
610 int const size = int(0.75 * fm.maxAscent());
611 int const y = yo_ - size;
612 int x = is_rtl ? nestMargin() + changebarMargin() : width_ - size;
614 if (width_ - int(row_.width()) <= size)
615 x += (size - width_ + row_.width() + 1) * (is_rtl ? -1 : 1);
617 if (endlabel == END_LABEL_BOX)
618 pain_.rectangle(x, y, size, size, LColor::eolmarker);
620 pain_.fillRectangle(x, y, size, size, LColor::eolmarker);
624 case END_LABEL_STATIC: {
625 LyXFont font = getLabelFont();
626 FontMetrics const & fm = theFontMetrics(font);
627 docstring const & str = par_.layout()->endlabelstring();
628 double const x = is_rtl ?
630 : - text_.rightMargin(par_) - row_.width();
631 pain_.text(int(x), yo_, str, font);
635 case END_LABEL_NO_LABEL:
641 void RowPainter::paintText()
643 pos_type const end = row_.endpos();
644 pos_type body_pos = par_.beginOfBody();
646 (body_pos > end || !par_.isLineSeparator(body_pos - 1))) {
650 LyXLayout_ptr const & layout = par_.layout();
652 bool running_strikeout = false;
653 bool is_struckout = false;
654 int last_strikeout_x = 0;
656 // Use font span to speed things up, see below
660 for (pos_type vpos = row_.pos(); vpos < end; ) {
661 if (x_ > bv_.workWidth())
664 pos_type const pos = text_.bidi.vis2log(vpos);
666 if (pos >= par_.size()) {
671 // Use font span to speed things up, see above
672 if (vpos < font_span.first || vpos > font_span.last) {
673 font_span = par_.fontSpan(vpos);
674 font = text_.getFont(par_, vpos);
677 const int width_pos =
678 text_.singleWidth(par_, pos, par_.getChar(pos), font);
680 if (x_ + width_pos < 0) {
686 is_struckout = par_.isDeleted(pos);
688 if (is_struckout && !running_strikeout) {
689 running_strikeout = true;
690 last_strikeout_x = int(x_);
693 bool const highly_editable_inset = par_.isInset(pos)
694 && isHighlyEditableInset(par_.getInset(pos));
696 // If we reach the end of a struck out range, paint it.
697 // We also don't paint across things like tables
698 if (running_strikeout && (highly_editable_inset || !is_struckout)) {
699 // Calculate 1/3 height of the buffer's default font
700 FontMetrics const & fm
701 = theFontMetrics(bv_.buffer()->params().getFont());
702 int const middle = yo_ - fm.maxAscent() / 3;
703 pain_.line(last_strikeout_x, middle, int(x_), middle,
704 LColor::strikeout, Painter::line_solid, Painter::line_thin);
705 running_strikeout = false;
708 if (body_pos > 0 && pos == body_pos - 1) {
710 int const lwidth = theFontMetrics(getLabelFont())
711 .width(from_utf8(layout->labelsep));
713 x_ += label_hfill_ + lwidth - width_pos;
716 if (par_.isHfill(pos)) {
720 int const y1 = y0 - defaultRowHeight() / 2;
722 pain_.line(int(x_), y1, int(x_), y0, LColor::added_space);
724 if (par_.hfillExpansion(row_, pos)) {
725 int const y2 = (y0 + y1) / 2;
727 if (pos >= body_pos) {
728 pain_.line(int(x_), y2, int(x_ + hfill_), y2,
730 Painter::line_onoffdash);
733 pain_.line(int(x_), y2, int(x_ + label_hfill_), y2,
735 Painter::line_onoffdash);
738 pain_.line(int(x_), y1, int(x_), y0, LColor::added_space);
742 } else if (par_.isSeparator(pos)) {
752 // if we reach the end of a struck out range, paint it
753 if (running_strikeout) {
754 // calculate 1/3 height of the buffer's default font
755 FontMetrics const & fm
756 = theFontMetrics(bv_.buffer()->params().getFont());
757 int const middle = yo_ - fm.maxAscent() / 3;
758 pain_.line(last_strikeout_x, middle, int(x_), middle,
759 LColor::strikeout, Painter::line_solid, Painter::line_thin);
760 running_strikeout = false;
765 size_type calculateRowSignature(Row const & row, Paragraph const & par,
768 boost::crc_32_type crc;
769 for (pos_type i = row.pos(); i < row.endpos(); ++i) {
770 char_type const b[] = { par.getChar(i) };
771 crc.process_bytes(b, 1);
773 char_type const b[] = { x, y, row.width() };
774 crc.process_bytes(b, 3);
775 return crc.checksum();
779 bool CursorOnRow(PainterInfo & pi, pit_type const pit,
780 RowList::const_iterator rit, LyXText const & text)
782 // Is there a cursor on this row (or inside inset on row)
783 LCursor & cur = pi.base.bv->cursor();
784 for (size_type d = 0; d < cur.depth(); ++d) {
785 CursorSlice const & sl = cur[d];
786 if (sl.text() == &text
788 && sl.pos() >= rit->pos()
789 && sl.pos() <= rit->endpos())
796 bool innerCursorOnRow(PainterInfo & pi, pit_type pit,
797 RowList::const_iterator rit, LyXText const & text)
799 // Is there a cursor inside an inset on this row, and is this inset
800 // the only "character" on this row
801 LCursor & cur = pi.base.bv->cursor();
802 if (rit->pos() + 1 != rit->endpos())
804 for (size_type d = 0; d < cur.depth(); d++) {
805 CursorSlice const & sl = cur[d];
806 if (sl.text() == &text
808 && sl.pos() == rit->pos())
809 return d < cur.depth() - 1;
816 (PainterInfo & pi, LyXText const & text, pit_type pit, int x, int y,
819 // lyxerr << " paintPar: pit: " << pit << " at y: " << y << endl;
820 int const ww = pi.base.bv->workHeight();
822 pi.base.bv->coordCache().parPos()[&text][pit] = Point(x, y);
824 Paragraph const & par = text.paragraphs()[pit];
825 if (par.rows().empty())
828 RowList::const_iterator const rb = par.rows().begin();
829 RowList::const_iterator const re = par.rows().end();
833 for (RowList::const_iterator rit = rb; rit != re; ++rit, ++rowno) {
835 // Allow setting of refreshInside for nested insets in
837 bool tmp = refreshInside;
839 // Row signature; has row changed since last paint?
840 size_type const row_sig = calculateRowSignature(*rit, par, x, y);
841 bool row_has_changed = par.rowSignature()[rowno] != row_sig;
843 bool cursor_on_row = CursorOnRow(pi, pit, rit, text);
844 bool in_inset_alone_on_row = innerCursorOnRow(pi, pit, rit,
847 // If this is the only object on the row, we can make it wide
848 for (pos_type i = rit->pos() ; i != rit->endpos(); ++i) {
849 InsetBase const * const in = par.getInset(i);
851 InsetText const * const t = in->asTextInset();
853 t->Wide() = in_inset_alone_on_row;
857 // If selection is on, the current row signature differs
858 // from cache, or cursor is inside an inset _on this row_,
859 // then paint the row
860 if (repaintAll || row_has_changed || cursor_on_row) {
861 // Add to row signature cache
862 par.rowSignature()[rowno] = row_sig;
864 bool const inside = (y + rit->descent() >= 0
865 && y - rit->ascent() < ww);
866 RowPainter rp(pi, text, pit, *rit, x, y);
867 // Clear background of this row
868 // (if paragraph background was not cleared)
870 (!in_inset_alone_on_row || row_has_changed)) {
871 pi.pain.fillRectangle(x, y - rit->ascent(),
872 text.maxwidth_, rit->height(),
873 text.backgroundColor());
874 // If outer row has changed, force nested
875 // insets to repaint completely
877 refreshInside = true;
880 // Instrumentation for testing row cache (see also
882 if (text.isMainText())
883 lyxerr[Debug::PAINTING] << "#";
885 lyxerr[Debug::PAINTING] << "[" <<
886 repaintAll << row_has_changed <<
887 cursor_on_row << "]";
898 // Restore, see above
901 lyxerr[Debug::PAINTING] << "." << endl;
907 void paintText(BufferView & bv, ViewMetricsInfo const & vi,
910 LyXText & text = bv.buffer()->text();
911 bool const select = bv.cursor().selection();
913 PainterInfo pi(const_cast<BufferView *>(&bv), pain);
914 // Should the whole screen, including insets, be refreshed?
915 bool repaintAll = select || !vi.singlepar;
918 // Clear background (if not delegated to rows)
919 pain.fillRectangle(0, vi.y1, bv.workWidth(), vi.y2 - vi.y1,
920 text.backgroundColor());
923 text.drawSelection(pi, 0, 0);
928 for (pit_type pit = vi.p1; pit <= vi.p2; ++pit) {
929 refreshInside = repaintAll;
930 Paragraph const & par = text.getPar(pit);
932 paintPar(pi, text, pit, 0, yy, repaintAll);
936 // Cache one paragraph above and one below
937 // Note MV: this cannot be suppressed even for singlepar.
938 // Try viewing the User Guide Mobius figure
941 text.redoParagraph(vi.p1 - 1);
942 bv.coordCache().parPos()[&text][vi.p1 - 1] =
943 Point(0, vi.y1 - text.getPar(vi.p1 - 1).descent());
946 if (vi.p2 < pit_type(text.paragraphs().size()) - 1) {
947 text.redoParagraph(vi.p2 + 1);
948 bv.coordCache().parPos()[&text][vi.p2 + 1] =
949 Point(0, vi.y2 + text.getPar(vi.p2 + 1).ascent());
952 // and grey out above (should not happen later)
953 // lyxerr << "par ascent: " << text.getPar(vi.p1).ascent() << endl;
954 if (vi.y1 > 0 && !vi.singlepar)
955 pain.fillRectangle(0, 0, bv.workWidth(), vi.y1, LColor::bottomarea);
957 // and possibly grey out below
958 // lyxerr << "par descent: " << text.getPar(vi.p1).ascent() << endl;
959 if (vi.y2 < bv.workHeight() && !vi.singlepar)
960 pain.fillRectangle(0, vi.y2, bv.workWidth(), bv.workHeight() - vi.y2, LColor::bottomarea);
964 void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y)
966 // lyxerr << " paintTextInset: y: " << y << endl;
968 y -= text.getPar(0).ascent();
969 // This flag can not be set from within same inset:
970 bool repaintAll = refreshInside;
971 for (int pit = 0; pit < int(text.paragraphs().size()); ++pit) {
972 y += text.getPar(pit).ascent();
973 paintPar(pi, text, pit, x, y, repaintAll);
974 y += text.getPar(pit).descent();