- pi_.pain.textDecoration(font, int(orig_x), yo_, int(width));
- x_ += width;
-}
-
-
-void RowPainter::paintForeignMark(double orig_x, Language const * lang, int desc) const
-{
- if (!lyxrc.mark_foreign_language)
- return;
- if (lang == latex_language)
- return;
- if (lang == pi_.base.bv->buffer().params().language)
- return;
-
- int const y = yo_ + solid_line_offset_ + desc + solid_line_thickness_ / 2;
- pi_.pain.line(int(orig_x), y, int(x_), y, Color_language,
- Painter::line_solid, solid_line_thickness_);
-}
-
-
-void RowPainter::paintMisspelledMark(double orig_x, bool changed) const
-{
- // if changed the misspelled marker gets placed slightly lower than normal
- // to avoid drawing at the same vertical offset
- float const y = yo_ + solid_line_offset_ + solid_line_thickness_
- + (changed ? solid_line_thickness_ + 1 : 0)
- + dotted_line_offset_;
- pi_.pain.line(int(orig_x), int(y), int(x_), int(y), Color_error,
- Painter::line_onoffdash, dotted_line_thickness_);
-}
-
-
-void RowPainter::paintFromPos(pos_type & vpos, bool changed)
-{
- pos_type const pos = bidi_.vis2log(vpos);
- Font const font = text_metrics_.displayFont(pit_, pos);
- double const orig_x = x_;
-
- paintChars(vpos, font);
- paintForeignMark(orig_x, font.language());
-
- // Paint the spelling mark if needed.
- if (lyxrc.spellcheck_continuously && par_.isMisspelled(pos)) {
- // check for cursor position
- // don't draw misspelled marker for words at cursor position
- // we don't want to disturb the process of text editing
- BufferView const * bv = pi_.base.bv;
- DocIterator const nw = bv->cursor().newWord();
- bool new_word = false;
- if (!nw.empty() && par_.id() == nw.paragraph().id()) {
- pos_type cpos = nw.pos();
- if (cpos > 0 && cpos == par_.size() && !par_.isWordSeparator(cpos-1))
- --cpos;
- else if (cpos > 0 && par_.isWordSeparator(cpos))
- --cpos;
- new_word = par_.isSameSpellRange(pos, cpos) ;
- }
- if (!new_word && pi_.do_spellcheck)
- paintMisspelledMark(orig_x, changed);
- }