]> git.lyx.org Git - lyx.git/blobdiff - src/RowPainter.cpp
Update tex2lyx tests
[lyx.git] / src / RowPainter.cpp
index 32636136b5a4a3713515f131970a5b494d5f86f8..efc4021c1b88f91da19f4d3241f336adc34a03ac 100644 (file)
@@ -157,9 +157,9 @@ void RowPainter::paintForeignMark(Row::Element const & e) const
                return;
 
        int const desc = e.inset ? e.dim.descent() : 0;
-       int const y = yo_ + pi_.base.solidLineOffset()
-               + desc + pi_.base.solidLineThickness() / 2;
-       pi_.pain.line(int(x_), y, int(x_ + e.full_width()), y, Color_language,
+       int const y = yo_ + min(3 * pi_.base.solidLineOffset() / 2 + desc,
+                               row_.descent() - 1);
+       pi_.pain.line(int(x_), y, int(x_ + e.full_width() - 1), y, Color_language,
                      Painter::line_solid, pi_.base.solidLineThickness());
 }
 
@@ -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);