From 87faeabae66aaa631de429b9a8db594e38deccb6 Mon Sep 17 00:00:00 2001 From: toorshia Date: Fri, 23 Sep 2016 01:07:00 +0200 Subject: [PATCH] https://github.com/toorshia/justgage/issues/245 --- README.md | 1 + justgage.js | 28 +++++++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index eb8c814..79373b4 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ JustGage is a handy JavaScript plugin for generating and animating nice & cl ######September 22, 2016. * **JustGage.prototype.destroy()** - added method to remove gauge node from DOM + * fixed https://github.com/toorshia/justgage/issues/146 ######September 20, 2016. Fixing filter paths trying to fetch invalid URLs https://github.com/toorshia/justgage/issues/245 diff --git a/justgage.js b/justgage.js index 8963035..f1b88e1 100644 --- a/justgage.js +++ b/justgage.js @@ -470,10 +470,15 @@ JustGage = function(config) { Cx = w / 2 + dx; Cy = h / 1.95 + dy; - Xo = w / 2 + dx + Ro * Math.cos(alpha); - Yo = h - (h - Cy) - Ro * Math.sin(alpha); - Xi = w / 2 + dx + Ri * Math.cos(alpha); - Yi = h - (h - Cy) - Ri * Math.sin(alpha); + // Xo = w / 2 + dx + Ro * Math.cos(alpha); + // Yo = h - (h - Cy) - Ro * Math.sin(alpha); + // Xi = w / 2 + dx + Ri * Math.cos(alpha); + // Yi = h - (h - Cy) - Ri * Math.sin(alpha); + + Xo = Cx + Ro * Math.cos(alpha); + Yo = Cy - Ro * Math.sin(alpha); + Xi = Cx + Ri * Math.cos(alpha); + Yi = Cy - Ri * Math.sin(alpha); path = "M" + (Cx - Ri) + "," + Cy + " "; path += "L" + (Cx - Ro) + "," + Cy + " "; @@ -500,10 +505,15 @@ JustGage = function(config) { Cx = w / 2 + dx; Cy = h / 1.25 + dy; - Xo = w / 2 + dx + Ro * Math.cos(alpha); - Yo = h - (h - Cy) - Ro * Math.sin(alpha); - Xi = w / 2 + dx + Ri * Math.cos(alpha); - Yi = h - (h - Cy) - Ri * Math.sin(alpha); + // Xo = w / 2 + dx + Ro * Math.cos(alpha); + // Yo = h - (h - Cy) - Ro * Math.sin(alpha); + // Xi = w / 2 + dx + Ri * Math.cos(alpha); + // Yi = h - (h - Cy) - Ri * Math.sin(alpha); + + Xo = Cx + Ro * Math.cos(alpha); + Yo = Cy - Ro * Math.sin(alpha); + Xi = Cx + Ri * Math.cos(alpha); + Yi = Cy - Ri * Math.sin(alpha); path = "M" + (Cx - Ri) + "," + Cy + " "; path += "L" + (Cx - Ro) + "," + Cy + " "; @@ -963,7 +973,7 @@ JustGage.prototype.refresh = function(val, max) { obj, displayVal, color, max = null; }; -/** Update gauge object */ +/** Destroy gauge object */ JustGage.prototype.destroy = function() { document.getElementById(this.config.id).innerHTML = ''; };