Commit 4e9c0c0b authored by David Schnur's avatar David Schnur

Ensure that axis lines align with their ticks.

Add an extra pixel to ensure that the lines cleanly join both top and
bottom ticks.  Also apply the sub-pixel offset only in the necessary
direction, so the lines don't start a pixel off from where they should.
parent 0594a491
......@@ -1873,13 +1873,16 @@ Licensed under the MIT license.
ctx.beginPath();
xoff = yoff = 0;
if (axis.direction == "x")
xoff = plotWidth;
xoff = plotWidth + 1;
else
yoff = plotHeight;
yoff = plotHeight + 1;
if (ctx.lineWidth == 1) {
x = Math.floor(x) + 0.5;
y = Math.floor(y) + 0.5;
if (axis.direction == "x") {
y = Math.floor(y) + 0.5;
} else {
x = Math.floor(x) + 0.5;
}
}
ctx.moveTo(x, y);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment