@@ -36,18 +36,16 @@ Phaser.Circle = function (x, y, diameter) {
3636 */
3737 this . _diameter = diameter ;
3838
39+ /**
40+ * @property {number } _radius - The radius of the circle.
41+ * @private
42+ */
43+ this . _radius = 0 ;
44+
3945 if ( diameter > 0 )
4046 {
41- /**
42- * @property {number } _radius - The radius of the circle.
43- * @private
44- */
4547 this . _radius = diameter * 0.5 ;
4648 }
47- else
48- {
49- this . _radius = 0 ;
50- }
5149
5250 /**
5351 * @property {number } type - The const type of this object.
@@ -59,24 +57,28 @@ Phaser.Circle = function (x, y, diameter) {
5957
6058Phaser . Circle . prototype = {
6159
62- type : null ,
63-
6460 /**
6561 * The circumference of the circle.
62+ *
6663 * @method Phaser.Circle#circumference
67- * @return {number }
64+ * @return {number } The circumference of the circle.
6865 */
6966 circumference : function ( ) {
67+
7068 return 2 * ( Math . PI * this . _radius ) ;
69+
7170 } ,
7271
7372 /**
74- * Returns the framing rectangle of the circle as a Phaser.Rectangle object
73+ * Returns the framing rectangle of the circle as a Phaser.Rectangle object.
74+ *
7575 * @method Phaser.Circle#getBounds
7676 * @return {Phaser.Rectangle } The bounds of the Circle.
7777 */
7878 getBounds : function ( ) {
79- return new Phaser . Rectangle ( this . x - this . radius , this . y - this . radius , this . radius * 2 , this . radius * 2 ) ;
79+
80+ return new Phaser . Rectangle ( this . x - this . radius , this . y - this . radius , this . diameter , this . diameter ) ;
81+
8082 } ,
8183
8284 /**
@@ -230,6 +232,7 @@ Phaser.Circle.prototype.constructor = Phaser.Circle;
230232
231233/**
232234* The largest distance between any two points on the circle. The same as the radius * 2.
235+ *
233236* @name Phaser.Circle#diameter
234237* @property {number } diameter - Gets or sets the diameter of the circle.
235238*/
0 commit comments