fixed Chrome 27 bug which was drawing circles as rectangles

This commit is contained in:
Eric Rowell
2013-06-06 21:56:40 -07:00
parent 8a5ad235bd
commit 51643bcada
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
(function() { (function() {
var PIx2 = Math.PI * 2, // the 0.0001 offset fixes a bug in Chrome 27
var PIx2 = (Math.PI * 2) - 0.0001,
CIRCLE = 'Circle'; CIRCLE = 'Circle';
/** /**
@@ -46,7 +47,7 @@
var context = canvas.getContext(); var context = canvas.getContext();
context.beginPath(); context.beginPath();
context.arc(0, 0, this.getRadius(), 0, PIx2, true); context.arc(0, 0, this.getRadius(), 0, PIx2, false);
context.closePath(); context.closePath();
canvas.fillStroke(this); canvas.fillStroke(this);
}, },

View File

@@ -13,7 +13,7 @@ Test.Modules.TWEEN = {
y: stage.getHeight() / 2, y: stage.getHeight() / 2,
radius: 70, radius: 70,
fill: 'green', fill: 'green',
stroke: 'black', stroke: 'blue',
strokeWidth: 4 strokeWidth: 4
}); });