]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Only draw positive radius arcs Fixes #592 1092/head
authorTanner Linsley <tannerlinsley@gmail.com>
Thu, 30 Apr 2015 21:49:52 +0000 (15:49 -0600)
committerTanner Linsley <tannerlinsley@gmail.com>
Thu, 30 Apr 2015 21:49:52 +0000 (15:49 -0600)
src/Chart.Core.js

index f6a6995bef462301221fd05fcef343b70133edea..2e26a8abb4bcb5965df840d5648756a486909183 100755 (executable)
 
                        ctx.beginPath();
 
-                       ctx.arc(this.x, this.y, this.outerRadius, this.startAngle, this.endAngle);
+                       ctx.arc(this.x, this.y, this.outerRadius < 0 ? 0 : this.outerRadius, this.startAngle, this.endAngle);
 
-                       ctx.arc(this.x, this.y, this.innerRadius, this.endAngle, this.startAngle, true);
+            ctx.arc(this.x, this.y, this.innerRadius < 0 ? 0 : this.innerRadius, this.endAngle, this.startAngle, true);
 
                        ctx.closePath();
                        ctx.strokeStyle = this.strokeColor;