Skip to content

Commit

Permalink
https://github.com/toorshia/justgage/issues/245
Browse files Browse the repository at this point in the history
  • Loading branch information
toorshia committed Sep 22, 2016
1 parent 94ffb99 commit 87faeab
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 19 additions & 9 deletions justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + " ";
Expand All @@ -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 + " ";
Expand Down Expand Up @@ -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 = '';
};
Expand Down

0 comments on commit 87faeab

Please # to comment.