Don't round markings to prevent sub-pixel problems

git-svn-id: https://flot.googlecode.com/svn/trunk@127 1e0a6537-2640-0410-bfb7-f154510ff394
pull/1/head
olau@iola.dk 17 years ago
parent d85d6ef990
commit b85766e1f9

@ -51,6 +51,8 @@ Bug fixes:
by exists, issue 75).
- Only set position relative on placeholder if it hasn't already a
position different from static (reported by kyberneticist, issue 95).
- Don't round markings to prevent sub-pixel problems (reported by Dan
Lipsitt).
Flot 0.5

@ -906,17 +906,18 @@
ctx.strokeStyle = m.color || options.grid.markingsColor;
ctx.beginPath();
ctx.lineWidth = m.lineWidth || options.grid.markingsLineWidth;
ctx.moveTo(Math.floor(xrange.from), Math.floor(yrange.from));
ctx.lineTo(Math.floor(xrange.to), Math.floor(yrange.to));
//ctx.moveTo(Math.floor(xrange.from), yrange.from);
//ctx.lineTo(Math.floor(xrange.to), yrange.to);
ctx.moveTo(xrange.from, yrange.from);
ctx.lineTo(xrange.to, yrange.to);
ctx.stroke();
}
else {
// fill area
ctx.fillStyle = m.color || options.grid.markingsColor;
ctx.fillRect(Math.floor(xrange.from),
Math.floor(yrange.to),
Math.floor(xrange.to - xrange.from),
Math.floor(yrange.from - yrange.to));
ctx.fillRect(xrange.from, yrange.to,
xrange.to - xrange.from,
yrange.from - yrange.to);
}
}
}

Loading…
Cancel
Save