From: Juergen Spitzmueller Date: Mon, 7 May 2018 06:41:28 +0000 (+0200) Subject: Paint nospell mark lower than foeign mark, since these can appear both X-Git-Tag: lyx-2.4.0dev-acb2ca7b~3461 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=2f2102d0ba1d8843a6c61733044a27c05de42d00;p=features.git Paint nospell mark lower than foeign mark, since these can appear both Also, assure that misspelled mark is not shown when nospellcheck() --- diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index 32636136b5..a929340478 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -170,12 +170,16 @@ void RowPainter::paintNoSpellingMark(Row::Element const & e) const // return; if (e.font.language() == latex_language) return; - if (!e.font.fontInfo().nospellcheck()) + if (e.font.fontInfo().nospellcheck() != FONT_ON) return; + // We at the same voffset than the misspelled mark, since + // these two are mutually exclusive int const desc = e.inset ? e.dim.descent() : 0; - int const y = yo_ + pi_.base.solidLineOffset() - + desc + pi_.base.solidLineThickness() / 2; + int const y = yo_ + pi_.base.solidLineOffset() + desc + + pi_.base.solidLineThickness() + + (e.change.changed() ? pi_.base.solidLineThickness() + 1 : 0) + + 1; pi_.pain.line(int(x_), y, int(x_ + e.full_width()), y, Color_language, Painter::line_onoffdash, pi_.base.solidLineThickness()); } @@ -183,6 +187,8 @@ void RowPainter::paintNoSpellingMark(Row::Element const & e) const void RowPainter::paintMisspelledMark(Row::Element const & e) const { + if (e.font.fontInfo().nospellcheck() == FONT_ON) + return; // if changed the misspelled marker gets placed slightly lower than normal // to avoid drawing at the same vertical offset FontMetrics const & fm = theFontMetrics(e.font);