]> git.lyx.org Git - lyx.git/blobdiff - src/Changes.cpp
Avoid duplicating mode changing commands
[lyx.git] / src / Changes.cpp
index e9191e37d80210958a8fa909e4fe31f0460b85f0..0d464d8fa26912b47e2dd74c78f2e0c70394366c 100644 (file)
@@ -22,6 +22,7 @@
 #include "MetricsInfo.h"
 #include "OutputParams.h"
 #include "Paragraph.h"
+#include "texstream.h"
 #include "TocBackend.h"
 
 #include "support/debug.h"
@@ -575,21 +576,22 @@ void Change::paintCue(PainterInfo & pi, double const x1, double const y1,
         * y2 /_____
         *    x1  x2
         */
-       double y = 0;
        switch(type) {
        case UNCHANGED:
                return;
        case INSERTED:
-               y = y2;
-               break;
+               pi.pain.line(int(x1), int(y2) + 1, int(x2), int(y2) + 1,
+                            color(), Painter::line_solid,
+                            pi.base.solidLineThickness());
+               return;
        case DELETED:
-               y = y1;
-               break;
+               // FIXME: we cannot use antialias since we keep drawing on the same
+               // background with the current painting mechanism.
+               pi.pain.line(int(x1), int(y2), int(x2), int(y1),
+                            color(), Painter::line_solid_aliased,
+                            pi.base.solidLineThickness());
+               return;
        }
-       // we cannot use antialias since we keep drawing on the same background
-       pi.pain.line(int(x1), int(y2), int(x2), int(y),
-                    color(), Painter::line_solid_aliased,
-                    pi.base.solidLineThickness());
 }