]> git.lyx.org Git - features.git/commitdiff
try to fix rounding errors
authorAndré Pönitz <poenitz@gmx.net>
Thu, 30 May 2002 14:56:13 +0000 (14:56 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Thu, 30 May 2002 14:56:13 +0000 (14:56 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4299 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/math_support.C

index 2dd4f234f849e222df072788eccc2fd96e56f95a..fe51c66d318699789df8fcc259b0fc65adf09964 100644 (file)
@@ -442,7 +442,7 @@ void mathed_draw_deco(MathPainterInfo & pain, int x, int y, int w, int h,
        if (r >= 2)
                x += w;
 
-       for (int i = 0; d[i];) {
+       for (int i = 0; d[i]; ) {
                int code = int(d[i++]);
                if (code & 1) {  // code == 1 || code == 3
                        double xx = d[i++];
@@ -454,8 +454,10 @@ void mathed_draw_deco(MathPainterInfo & pain, int x, int y, int w, int h,
                        else
                                mt.transform(xx, yy);
                        mt.transform(x2, y2);
-                       pain.pain.line(x + int(xx), y + int(yy), x + int(x2), y + int(y2),
-                                       LColor::math);
+                       pain.pain.line(
+                               x + int(xx + 0.5), y + int(yy + 0.5),
+                               x + int(x2 + 0.5), y + int(y2 + 0.5),
+                               LColor::math);
                }       else {
                        int xp[32];
                        int yp[32];
@@ -468,8 +470,8 @@ void mathed_draw_deco(MathPainterInfo & pain, int x, int y, int w, int h,
                                        sqmt.transform(xx, yy);
                                else
                                        mt.transform(xx, yy);
-                               xp[j] = x + int(xx);
-                               yp[j] = y + int(yy);
+                               xp[j] = x + int(xx + 0.5);
+                               yp[j] = y + int(yy + 0.5);
                                //  lyxerr << "P[" << j " " << xx << " " << yy << " " << x << " " << y << "]";
                        }
                        pain.pain.lines(xp, yp, n, LColor::math);