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;
271 str.push_back(par_.getChar(pos));
274 char_type c = str[0];
275 str[0] = par_.transformChar(c, pos);
278 // collect as much similar chars as we can
279 for (++vpos ; vpos < end ; ++vpos) {
280 pos = text_.bidi.vis2log(vpos);
281 if (pos < font_span.first || pos > font_span.last)
284 if (prev_change != par_.lookupChange(pos).type)
287 char_type c = par_.getChar(pos);
289 if (!isPrintableNonspace(c))
292 if (arabic && Encodings::isComposeChar_arabic(c))
295 if (hebrew && Encodings::isComposeChar_hebrew(c))
299 c = par_.transformChar(c, pos);
308 if (prev_change == Change::DELETED)
309 font.setColor(LColor::strikeout);
310 else if (prev_change == Change::INSERTED)
311 font.setColor(LColor::newtext);
313 // Draw text and set the new x position
314 //lyxerr << "paint row: yo_ " << yo_ << "\n";
316 int width = pain_.text(int(x_), yo_, str, font);
318 int width = pain_.text(int(x_), yo_, &str[0], str.size(), font);
324 void RowPainter::paintForeignMark(double orig_x, LyXFont const & font, int desc)
326 if (!lyxrc.mark_foreign_language)
328 if (font.language() == latex_language)
330 if (font.language() == bv_.buffer()->params().language)
333 int const y = yo_ + 1 + desc;
334 pain_.line(int(orig_x), y, int(x_), y, LColor::language);
338 void RowPainter::paintFromPos(pos_type & vpos)
340 pos_type const pos = text_.bidi.vis2log(vpos);
341 LyXFont orig_font = text_.getFont(par_, pos);
343 double const orig_x = x_;
345 if (par_.isInset(pos)) {
346 paintInset(pos, orig_font);
348 paintForeignMark(orig_x, orig_font,
349 par_.getInset(pos)->descent());
353 // usual characters, no insets
354 char_type const c = par_.getChar(pos);
356 // special case languages
357 std::string const & lang = orig_font.language()->lang();
358 bool const hebrew = lang == "hebrew";
359 bool const arabic = lang == "arabic" &&
360 (lyxrc.font_norm_type == LyXRC::ISO_8859_6_8 ||
361 lyxrc.font_norm_type == LyXRC::ISO_10646_1);
363 // draw as many chars as we can
364 if ((!hebrew && !arabic)
365 || (hebrew && !Encodings::isComposeChar_hebrew(c))
366 || (arabic && !Encodings::isComposeChar_arabic(c))) {
367 paintChars(vpos, orig_font, hebrew, arabic);
369 paintHebrewComposeChar(vpos, orig_font);
371 paintArabicComposeChar(vpos, orig_font);
374 paintForeignMark(orig_x, orig_font);
378 void RowPainter::paintChangeBar()
380 pos_type const start = row_.pos();
381 pos_type const end = row_.endpos();
383 if (start == end || !par_.isChanged(start, end))
386 int const height = text_.isLastRow(pit_, row_)
390 pain_.fillRectangle(5, yo_ - row_.ascent(), 3, height, LColor::changebar);
394 void RowPainter::paintAppendix()
396 if (!par_.params().appendix())
399 int y = yo_ - row_.ascent();
401 if (par_.params().startOfAppendix())
402 y += 2 * defaultRowHeight();
404 pain_.line(1, y, 1, yo_ + row_.height(), LColor::appendix);
405 pain_.line(width_ - 2, y, width_ - 2, yo_ + row_.height(), LColor::appendix);
409 void RowPainter::paintDepthBar()
411 depth_type const depth = par_.getDepth();
416 depth_type prev_depth = 0;
417 if (!text_.isFirstRow(pit_, row_)) {
418 pit_type pit2 = pit_;
421 prev_depth = pars_[pit2].getDepth();
424 depth_type next_depth = 0;
425 if (!text_.isLastRow(pit_, row_)) {
426 pit_type pit2 = pit_;
427 if (row_.endpos() >= pars_[pit2].size())
429 next_depth = pars_[pit2].getDepth();
432 for (depth_type i = 1; i <= depth; ++i) {
433 int const w = nestMargin() / 5;
434 int x = int(xo_) + w * i;
435 // only consider the changebar space if we're drawing outermost text
436 if (text_.isMainText())
437 x += changebarMargin();
439 int const starty = yo_ - row_.ascent();
440 int const h = row_.height() - 1 - (i - next_depth - 1) * 3;
442 pain_.line(x, starty, x, starty + h, LColor::depthbar);
445 pain_.fillRectangle(x, starty, w, 2, LColor::depthbar);
447 pain_.fillRectangle(x, starty + h, w, 2, LColor::depthbar);
452 int RowPainter::paintAppendixStart(int y)
455 pb_font.setColor(LColor::appendix);
462 docstring const label = _("Appendix");
463 theFontMetrics(pb_font).rectText(label, w, a, d);
465 int const text_start = int(xo_ + (width_ - w) / 2);
466 int const text_end = text_start + w;
468 pain_.rectText(text_start, y + d, label, pb_font, LColor::none, LColor::none);
470 pain_.line(int(xo_ + 1), y, text_start, y, LColor::appendix);
471 pain_.line(text_end, y, int(xo_ + width_ - 2), y, LColor::appendix);
473 return 3 * defaultRowHeight();
477 void RowPainter::paintFirst()
479 ParagraphParameters const & parparams = par_.params();
483 // start of appendix?
484 if (parparams.startOfAppendix())
485 y_top += paintAppendixStart(yo_ - row_.ascent() + 2 * defaultRowHeight());
487 Buffer const & buffer = *bv_.buffer();
489 LyXLayout_ptr const & layout = par_.layout();
491 if (buffer.params().paragraph_separation == BufferParams::PARSEP_SKIP) {
493 if (layout->latextype == LATEX_PARAGRAPH
494 && !par_.getDepth()) {
495 y_top += buffer.params().getDefSkip().inPixels(bv_);
497 LyXLayout_ptr const & playout = pars_[pit_ - 1].layout();
498 if (playout->latextype == LATEX_PARAGRAPH
499 && !pars_[pit_ - 1].getDepth()) {
500 // is it right to use defskip here, too? (AS)
501 y_top += buffer.params().getDefSkip().inPixels(bv_);
507 bool const is_rtl = text_.isRTL(par_);
508 bool const is_seq = isFirstInSequence(pit_, text_.paragraphs());
509 //lyxerr << "paintFirst: " << par_.id() << " is_seq: " << is_seq << std::endl;
511 // should we print a label?
512 if (layout->labeltype >= LABEL_STATIC
513 && (layout->labeltype != LABEL_STATIC
514 || layout->latextype != LATEX_ENVIRONMENT
517 LyXFont const font = getLabelFont();
518 FontMetrics const & fm = theFontMetrics(font);
520 docstring const str = par_.getLabelstring();
524 // this is special code for the chapter layout. This is
525 // printed in an extra row and has a pagebreak at
527 if (layout->counter == "chapter") {
528 double spacing_val = 1.0;
529 if (!parparams.spacing().isDefault()) {
530 spacing_val = parparams.spacing().getValue();
532 spacing_val = buffer.params().spacing().getValue();
535 int const labeladdon = int(fm.maxHeight() * layout->spacing.getValue() * spacing_val);
537 int const maxdesc = int(fm.maxDescent() * layout->spacing.getValue() * spacing_val)
538 + int(layout->parsep) * defaultRowHeight();
541 x = width_ - leftMargin() -
545 pain_.text(int(x), yo_ - maxdesc - labeladdon, str, font);
548 docstring lab = from_utf8(layout->labelsep);
550 x = width_ - leftMargin()
553 x = x_ - fm.width(lab)
557 pain_.text(int(x), yo_, str, font);
561 // the labels at the top of an environment.
562 // More or less for bibliography
564 (layout->labeltype == LABEL_TOP_ENVIRONMENT ||
565 layout->labeltype == LABEL_BIBLIO ||
566 layout->labeltype == LABEL_CENTERED_TOP_ENVIRONMENT)) {
567 LyXFont font = getLabelFont();
568 if (!par_.getLabelstring().empty()) {
569 docstring const str = par_.getLabelstring();
570 double spacing_val = 1.0;
571 if (!parparams.spacing().isDefault())
572 spacing_val = parparams.spacing().getValue();
574 spacing_val = buffer.params().spacing().getValue();
576 FontMetrics const & fm = theFontMetrics(font);
578 int const labeladdon = int(fm.maxHeight()
579 * layout->spacing.getValue() * spacing_val);
582 int(fm.maxDescent() * layout->spacing.getValue() * spacing_val
583 + (layout->labelbottomsep * defaultRowHeight()));
586 if (layout->labeltype == LABEL_CENTERED_TOP_ENVIRONMENT) {
589 x += (width_ - text_.rightMargin(par_) - leftMargin()) / 2;
590 x -= fm.width(str) / 2;
592 x = width_ - leftMargin() - fm.width(str);
594 pain_.text(int(x), yo_ - maxdesc - labeladdon, str, font);
600 void RowPainter::paintLast()
602 bool const is_rtl = text_.isRTL(par_);
603 int const endlabel = getEndLabel(pit_, text_.paragraphs());
608 case END_LABEL_FILLED_BOX: {
609 LyXFont const font = getLabelFont();
610 FontMetrics const & fm = theFontMetrics(font);
611 int const size = int(0.75 * fm.maxAscent());
612 int const y = yo_ - size;
613 int x = is_rtl ? nestMargin() + changebarMargin() : width_ - size;
615 if (width_ - int(row_.width()) <= size)
616 x += (size - width_ + row_.width() + 1) * (is_rtl ? -1 : 1);
618 if (endlabel == END_LABEL_BOX)
619 pain_.rectangle(x, y, size, size, LColor::eolmarker);
621 pain_.fillRectangle(x, y, size, size, LColor::eolmarker);
625 case END_LABEL_STATIC: {
626 LyXFont font = getLabelFont();
627 FontMetrics const & fm = theFontMetrics(font);
628 docstring const & str = par_.layout()->endlabelstring();
629 double const x = is_rtl ?
631 : - text_.rightMargin(par_) - row_.width();
632 pain_.text(int(x), yo_, str, font);
636 case END_LABEL_NO_LABEL:
642 void RowPainter::paintText()
644 pos_type const end = row_.endpos();
645 pos_type body_pos = par_.beginOfBody();
647 (body_pos > end || !par_.isLineSeparator(body_pos - 1))) {
651 LyXLayout_ptr const & layout = par_.layout();
653 bool running_strikeout = false;
654 bool is_struckout = false;
655 int last_strikeout_x = 0;
657 // Use font span to speed things up, see below
661 for (pos_type vpos = row_.pos(); vpos < end; ) {
662 if (x_ > bv_.workWidth())
665 pos_type const pos = text_.bidi.vis2log(vpos);
667 if (pos >= par_.size()) {
672 // Use font span to speed things up, see above
673 if (vpos < font_span.first || vpos > font_span.last) {
674 font_span = par_.fontSpan(vpos);
675 font = text_.getFont(par_, vpos);
678 const int width_pos =
679 text_.singleWidth(par_, pos, par_.getChar(pos), font);
681 if (x_ + width_pos < 0) {
687 is_struckout = par_.isDeleted(pos);
689 if (is_struckout && !running_strikeout) {
690 running_strikeout = true;
691 last_strikeout_x = int(x_);
694 bool const highly_editable_inset = par_.isInset(pos)
695 && isHighlyEditableInset(par_.getInset(pos));
697 // If we reach the end of a struck out range, paint it.
698 // We also don't paint across things like tables
699 if (running_strikeout && (highly_editable_inset || !is_struckout)) {
700 // Calculate 1/3 height of the buffer's default font
701 FontMetrics const & fm
702 = theFontMetrics(bv_.buffer()->params().getFont());
703 int const middle = yo_ - fm.maxAscent() / 3;
704 pain_.line(last_strikeout_x, middle, int(x_), middle,
705 LColor::strikeout, Painter::line_solid, Painter::line_thin);
706 running_strikeout = false;
709 if (body_pos > 0 && pos == body_pos - 1) {
711 int const lwidth = theFontMetrics(getLabelFont())
712 .width(from_utf8(layout->labelsep));
714 x_ += label_hfill_ + lwidth - width_pos;
717 if (par_.isHfill(pos)) {
721 int const y1 = y0 - defaultRowHeight() / 2;
723 pain_.line(int(x_), y1, int(x_), y0, LColor::added_space);
725 if (par_.hfillExpansion(row_, pos)) {
726 int const y2 = (y0 + y1) / 2;
728 if (pos >= body_pos) {
729 pain_.line(int(x_), y2, int(x_ + hfill_), y2,
731 Painter::line_onoffdash);
734 pain_.line(int(x_), y2, int(x_ + label_hfill_), y2,
736 Painter::line_onoffdash);
739 pain_.line(int(x_), y1, int(x_), y0, LColor::added_space);
743 } else if (par_.isSeparator(pos)) {
753 // if we reach the end of a struck out range, paint it
754 if (running_strikeout) {
755 // calculate 1/3 height of the buffer's default font
756 FontMetrics const & fm
757 = theFontMetrics(bv_.buffer()->params().getFont());
758 int const middle = yo_ - fm.maxAscent() / 3;
759 pain_.line(last_strikeout_x, middle, int(x_), middle,
760 LColor::strikeout, Painter::line_solid, Painter::line_thin);
761 running_strikeout = false;
766 size_type calculateRowSignature(Row const & row, Paragraph const & par,
769 boost::crc_32_type crc;
770 for (pos_type i = row.pos(); i < row.endpos(); ++i) {
771 char_type const b[] = { par.getChar(i) };
772 crc.process_bytes(b, 1);
774 char_type const b[] = { x, y, row.width() };
775 crc.process_bytes(b, 3);
776 return crc.checksum();
780 bool CursorOnRow(PainterInfo & pi, pit_type const pit,
781 RowList::const_iterator rit, LyXText const & text)
783 // Is there a cursor on this row (or inside inset on row)
784 LCursor & cur = pi.base.bv->cursor();
785 for (size_type d = 0; d < cur.depth(); ++d) {
786 CursorSlice const & sl = cur[d];
787 if (sl.text() == &text
789 && sl.pos() >= rit->pos()
790 && sl.pos() <= rit->endpos())
797 bool innerCursorOnRow(PainterInfo & pi, pit_type pit,
798 RowList::const_iterator rit, LyXText const & text)
800 // Is there a cursor inside an inset on this row, and is this inset
801 // the only "character" on this row
802 LCursor & cur = pi.base.bv->cursor();
803 if (rit->pos() + 1 != rit->endpos())
805 for (size_type d = 0; d < cur.depth(); d++) {
806 CursorSlice const & sl = cur[d];
807 if (sl.text() == &text
809 && sl.pos() == rit->pos())
810 return d < cur.depth() - 1;
817 (PainterInfo & pi, LyXText const & text, pit_type pit, int x, int y,
820 // lyxerr << " paintPar: pit: " << pit << " at y: " << y << endl;
821 int const ww = pi.base.bv->workHeight();
823 pi.base.bv->coordCache().parPos()[&text][pit] = Point(x, y);
825 Paragraph const & par = text.paragraphs()[pit];
826 if (par.rows().empty())
829 RowList::const_iterator const rb = par.rows().begin();
830 RowList::const_iterator const re = par.rows().end();
834 for (RowList::const_iterator rit = rb; rit != re; ++rit, ++rowno) {
836 // Allow setting of refreshInside for nested insets in
838 bool tmp = refreshInside;
840 // Row signature; has row changed since last paint?
841 size_type const row_sig = calculateRowSignature(*rit, par, x, y);
842 bool row_has_changed = par.rowSignature()[rowno] != row_sig;
844 bool cursor_on_row = CursorOnRow(pi, pit, rit, text);
845 bool in_inset_alone_on_row = innerCursorOnRow(pi, pit, rit,
848 // If this is the only object on the row, we can make it wide
849 for (pos_type i = rit->pos() ; i != rit->endpos(); ++i) {
850 InsetBase const * const in = par.getInset(i);
852 InsetText const * const t = in->asTextInset();
854 t->Wide() = in_inset_alone_on_row;
858 // If selection is on, the current row signature differs
859 // from cache, or cursor is inside an inset _on this row_,
860 // then paint the row
861 if (repaintAll || row_has_changed || cursor_on_row) {
862 // Add to row signature cache
863 par.rowSignature()[rowno] = row_sig;
865 bool const inside = (y + rit->descent() >= 0
866 && y - rit->ascent() < ww);
867 RowPainter rp(pi, text, pit, *rit, x, y);
868 // Clear background of this row
869 // (if paragraph background was not cleared)
871 (!in_inset_alone_on_row || row_has_changed)) {
872 pi.pain.fillRectangle(x, y - rit->ascent(),
873 text.maxwidth_, rit->height(),
874 text.backgroundColor());
875 // If outer row has changed, force nested
876 // insets to repaint completely
878 refreshInside = true;
881 // Instrumentation for testing row cache (see also
883 if (text.isMainText())
884 lyxerr[Debug::PAINTING] << "#";
886 lyxerr[Debug::PAINTING] << "[" <<
887 repaintAll << row_has_changed <<
888 cursor_on_row << "]";
899 // Restore, see above
902 lyxerr[Debug::PAINTING] << "." << endl;
908 void paintText(BufferView & bv, ViewMetricsInfo const & vi,
911 LyXText & text = bv.buffer()->text();
912 bool const select = bv.cursor().selection();
914 PainterInfo pi(const_cast<BufferView *>(&bv), pain);
915 // Should the whole screen, including insets, be refreshed?
916 bool repaintAll = select || !vi.singlepar;
919 // Clear background (if not delegated to rows)
920 pain.fillRectangle(0, vi.y1, bv.workWidth(), vi.y2 - vi.y1,
921 text.backgroundColor());
924 text.drawSelection(pi, 0, 0);
929 for (pit_type pit = vi.p1; pit <= vi.p2; ++pit) {
930 refreshInside = repaintAll;
931 Paragraph const & par = text.getPar(pit);
933 paintPar(pi, text, pit, 0, yy, repaintAll);
937 // Cache one paragraph above and one below
938 // Note MV: this cannot be suppressed even for singlepar.
939 // Try viewing the User Guide Mobius figure
942 text.redoParagraph(vi.p1 - 1);
943 bv.coordCache().parPos()[&text][vi.p1 - 1] =
944 Point(0, vi.y1 - text.getPar(vi.p1 - 1).descent());
947 if (vi.p2 < pit_type(text.paragraphs().size()) - 1) {
948 text.redoParagraph(vi.p2 + 1);
949 bv.coordCache().parPos()[&text][vi.p2 + 1] =
950 Point(0, vi.y2 + text.getPar(vi.p2 + 1).ascent());
953 // and grey out above (should not happen later)
954 // lyxerr << "par ascent: " << text.getPar(vi.p1).ascent() << endl;
955 if (vi.y1 > 0 && !vi.singlepar)
956 pain.fillRectangle(0, 0, bv.workWidth(), vi.y1, LColor::bottomarea);
958 // and possibly grey out below
959 // lyxerr << "par descent: " << text.getPar(vi.p1).ascent() << endl;
960 if (vi.y2 < bv.workHeight() && !vi.singlepar)
961 pain.fillRectangle(0, vi.y2, bv.workWidth(), bv.workHeight() - vi.y2, LColor::bottomarea);
965 void paintTextInset(LyXText const & text, PainterInfo & pi, int x, int y)
967 // lyxerr << " paintTextInset: y: " << y << endl;
969 y -= text.getPar(0).ascent();
970 // This flag can not be set from within same inset:
971 bool repaintAll = refreshInside;
972 for (int pit = 0; pit < int(text.paragraphs().size()); ++pit) {
973 y += text.getPar(pit).ascent();
974 paintPar(pi, text, pit, x, y, repaintAll);
975 y += text.getPar(pit).descent();