void paintText();
private:
- void paintForeignMark(double orig_x, LyXFont const & font);
+ void paintForeignMark(double orig_x, LyXFont const & font, int desc = 0);
void paintHebrewComposeChar(lyx::pos_type & vpos, LyXFont const & font);
void paintArabicComposeChar(lyx::pos_type & vpos, LyXFont const & font);
void paintChars(lyx::pos_type & vpos, LyXFont font,
// FIXME: We should always use font, see documentation of
// noFontChange() in insetbase.h.
pi.base.font = inset->noFontChange() ?
- bv_.buffer()->params().getLyXTextClass().defaultfont() :
+ bv_.buffer()->params().getFont() :
font;
pi.ltr_pos = (text_.bidi.level(pos) % 2 == 0);
pi.erased_ = erased_ || isDeletedText(par_, pos);
}
-void RowPainter::paintForeignMark(double orig_x, LyXFont const & font)
+void RowPainter::paintForeignMark(double orig_x, LyXFont const & font, int desc)
{
if (!lyxrc.mark_foreign_language)
return;
if (font.language() == bv_.buffer()->params().language)
return;
- int const y = yo_ + 1;
+ int const y = yo_ + 1 + desc;
pain_.line(int(orig_x), y, int(x_), y, LColor::language);
}
{
pos_type const pos = text_.bidi.vis2log(vpos);
LyXFont orig_font = text_.getFont(par_, pos);
- text_.applyOuterFont(orig_font);
double const orig_x = x_;
if (par_.isInset(pos)) {
paintInset(pos, orig_font);
++vpos;
- paintForeignMark(orig_x, orig_font);
+ paintForeignMark(orig_x, orig_font,
+ par_.getInset(pos)->descent());
return;
}
if (running_strikeout && (highly_editable_inset || !is_struckout)) {
// Calculate 1/3 height of the buffer's default font
int const middle =
- yo_ - font_metrics::maxAscent(text_.defaultfont_) / 3;
+ yo_ -
+ font_metrics::maxAscent(bv_.buffer()->params().getFont()) / 3;
pain_.line(last_strikeout_x, middle, int(x_), middle,
LColor::strikeout, Painter::line_solid, Painter::line_thin);
running_strikeout = false;
if (running_strikeout) {
// calculate 1/3 height of the buffer's default font
int const middle =
- yo_ - font_metrics::maxAscent(text_.defaultfont_) / 3;
+ yo_ -
+ font_metrics::maxAscent(bv_.buffer()->params().getFont()) / 3;
pain_.line(last_strikeout_x, middle, int(x_), middle,
LColor::strikeout, Painter::line_solid, Painter::line_thin);
running_strikeout = false;
for (lyx::size_type d = 0; d < cur.depth(); d++)
if (cur[d].pit() == pit
&& cur[d].pos() >= rit->pos()
- && cur[d].pos() < rit->endpos())
+ && cur[d].pos() <= rit->endpos())
return true;
return false;
}