try to fix rounding errors

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4299 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2002-05-30 14:56:13 +00:00
parent 67c8370f50
commit e093e5e80c

View File

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