Fix wrong Shape.Circle size.

This commit is contained in:
Jürg Lehni 2013-04-20 20:53:40 -07:00
parent db7eb65bd7
commit 2793709935

View file

@ -40,7 +40,8 @@ var Shape = this.Shape = Item.extend(/** @lends Shape# */{
ctx.rect(-width / 2, -height / 2, width, height);
break;
case 'circle':
ctx.arc(0, 0, width, 0, Math.PI * 2, true);
// Average half of width & height for radius...
ctx.arc(0, 0, (width + height) / 4, 0, Math.PI * 2, true);
break;
case 'ellipse':
var mx = width / 2,
@ -85,7 +86,7 @@ var Shape = this.Shape = Item.extend(/** @lends Shape# */{
Circle: function(/* center, radius */) {
var center = Point.readNamed(arguments, 'center'),
radius = Base.readNamed(arguments, 'radius');
return new Shape('circle', center, new Size(radius));
return new Shape('circle', center, new Size(radius * 2));
},
Rectangle: function(/* rectangle */) {