]> git.lyx.org Git - lyx.git/blobdiff - src/RowPainter.cpp
Cmake build: Only use the new lyxconvert on MAC
[lyx.git] / src / RowPainter.cpp
index 91dfb63e4d5331c6f4d9808394380ca360c67437..2d7e12c445e2bb8d22efe7af6f969459d1e93580 100644 (file)
@@ -205,7 +205,7 @@ void RowPainter::paintMisspelledMark(Row::Element const & e) const
                if (x1 > x2)
                        swap(x1, x2);
 
-               pi_.pain.line(int(x_ + x1), y, int(x_ + x2), y, 
+               pi_.pain.line(int(x_ + x1), y, int(x_ + x2), y,
                              Color_error,
                              Painter::line_onoffdash, thickness);
                pos = range.last + 1;
@@ -640,8 +640,9 @@ void RowPainter::paintSelection() const
                        double x2 = e.pos2x(to);
                        if (x1 > x2)
                                swap(x1, x2);
-                       pi_.pain.fillRectangle(int(x + x1), y1, int(x2 - x1), y2 - y1,
-                                              Color_selection);
+                       // the 3rd argument is written like that to avoid rounding issues
+                       pi_.pain.fillRectangle(int(x + x1), y1, int(x2 + x) - int(x1 + x),
+                                              y2 - y1, Color_selection);
                }
                x += e.full_width();
        }