From b85766e1f986c0371e1da7b1f2e2e2e3fc6d25cb Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Tue, 13 Jan 2009 12:14:23 +0000 Subject: [PATCH] Don't round markings to prevent sub-pixel problems git-svn-id: https://flot.googlecode.com/svn/trunk@127 1e0a6537-2640-0410-bfb7-f154510ff394 --- NEWS.txt | 2 ++ jquery.flot.js | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index ab0639d..0b1fa69 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -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 diff --git a/jquery.flot.js b/jquery.flot.js index 42190da..1e7a930 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -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); } } }