Skip to content

Commit 09dfada

Browse files
committed
Correct geometry clone argument types
Fixes #475 Thanks @bseiller
1 parent c8309b4 commit 09dfada

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ Written something cool in Phaser? Please tell us about it in the [forum][forum],
348348
* Fixed circular Arcade bodies sticking to each other during some collisions (#451).
349349
* Fixed a sprite with `input.enabled=false` triggering its onInputOut signal when the mouse leaves the game canvas (#454).
350350
* Fixed spelling error in API documentation (#458).
351-
* Fixed some TypeScript definitions (#442, #447, #455, #460, #462, #463, #469).
351+
* Fixed some TypeScript definitions (#442, #447, #455, #460, #462, #463, #469, #475).
352352
* The canvas now correctly scales inside a container div if using relative values for `width`/`height` in the [Phaser.Game](https://photonstorm.github.io/phaser-ce/Phaser.Game.html) constructor (#367). Make sure you give the container a [height](https://developer.mozilla.org/en-US/docs/Web/CSS/height).
353353
* Fixed State#loadUpdate being called once when no assets have been loaded (#468).
354354
* Fixed Debug#spriteInfo failing to show `sprite.name` as promised (#471).

src/geom/Circle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Phaser.Circle.prototype = {
171171
/**
172172
* Returns a new Circle object with the same values for the x, y, width, and height properties as this Circle object.
173173
* @method Phaser.Circle#clone
174-
* @param {Phaser.Circle} output - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
174+
* @param {Phaser.Circle} [output] - Optional Circle object. If given the values will be set into the object, otherwise a brand new Circle object will be created and returned.
175175
* @return {Phaser.Circle} The cloned Circle object.
176176
*/
177177
clone: function (output) {

src/geom/Ellipse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Phaser.Ellipse.prototype = {
117117
/**
118118
* Returns a new Ellipse object with the same values for the x, y, width, and height properties as this Ellipse object.
119119
* @method Phaser.Ellipse#clone
120-
* @param {Phaser.Ellipse} output - Optional Ellipse object. If given the values will be set into the object, otherwise a brand new Ellipse object will be created and returned.
120+
* @param {Phaser.Ellipse} [output] - Optional Ellipse object. If given the values will be set into the object, otherwise a brand new Ellipse object will be created and returned.
121121
* @return {Phaser.Ellipse} The cloned Ellipse object.
122122
*/
123123
clone: function(output) {

src/geom/Line.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ Phaser.Line.prototype = {
353353
/**
354354
* Returns a new Line object with the same values for the start and end properties as this Line object.
355355
* @method Phaser.Line#clone
356-
* @param {Phaser.Line} output - Optional Line object. If given the values will be set into the object, otherwise a brand new Line object will be created and returned.
356+
* @param {Phaser.Line} [output] - Optional Line object. If given the values will be set into the object, otherwise a brand new Line object will be created and returned.
357357
* @return {Phaser.Line} The cloned Line object.
358358
*/
359359
clone: function (output) {

src/geom/Polygon.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Phaser.Polygon.prototype = {
111111
* This is a deep clone, the resulting copy contains new Phaser.Point objects
112112
*
113113
* @method Phaser.Polygon#clone
114-
* @param {Phaser.Polygon} [output=(new Polygon)] - The polygon to update. If not specified a new polygon will be created.
114+
* @param {Phaser.Polygon} [output=(new Phaser.Polygon)] - The polygon to update. If not specified a new polygon will be created.
115115
* @return {Phaser.Polygon} The cloned (`output`) polygon object.
116116
*/
117117
clone: function (output) {

typescript/phaser.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ declare module Phaser {
768768

769769
circumference(): number;
770770
circumferencePoint(angle: number, asDegrees?: boolean, out?: Phaser.Point): Phaser.Point;
771-
clone(output: Phaser.Circle): Phaser.Circle;
771+
clone(output?: Phaser.Circle): Phaser.Circle;
772772
contains(x: number, y: number): boolean;
773773
copyFrom(source: any): Circle;
774774
copyTo(dest: any): any;
@@ -1129,7 +1129,7 @@ declare module Phaser {
11291129

11301130
static constains(a: Phaser.Ellipse, x: number, y: number): boolean;
11311131

1132-
clone(output: Phaser.Ellipse): Phaser.Ellipse;
1132+
clone(output?: Phaser.Ellipse): Phaser.Ellipse;
11331133
contains(x: number, y: number): boolean;
11341134
copyFrom(source: any): Phaser.Ellipse;
11351135
copyTo(dest: any): any;
@@ -2558,7 +2558,7 @@ declare module Phaser {
25582558
static reflect(a: Phaser.Line, b: Phaser.Line): number;
25592559

25602560
centerOn(x: number, y: number): Phaser.Line;
2561-
clone(output: Phaser.Line): Phaser.Line;
2561+
clone(output?: Phaser.Line): Phaser.Line;
25622562
coordinatesOnLine(stepRate: number, results: any[]): any[];
25632563
fromAngle(x: number, y: number, angle: number, length: number): Phaser.Line;
25642564
fromPoints(start: any, end: any): Phaser.Line;
@@ -4248,7 +4248,7 @@ declare module Phaser {
42484248
points: number[] | Phaser.Point[];
42494249
type: number;
42504250

4251-
clone(output: Phaser.Polygon): Phaser.Polygon;
4251+
clone(output?: Phaser.Polygon): Phaser.Polygon;
42524252
contains(x: number, y: number): boolean;
42534253
flatten(): Phaser.Polygon;
42544254
setTo(points: Phaser.Point[] | number[]): void;
@@ -4357,7 +4357,7 @@ declare module Phaser {
43574357
ceil(): void;
43584358
ceilAll(): void;
43594359
centerOn(x: number, y: number): Phaser.Rectangle;
4360-
clone(output: Phaser.Rectangle): Phaser.Rectangle;
4360+
clone(output?: Phaser.Rectangle): Phaser.Rectangle;
43614361
contains(x: number, y: number): boolean;
43624362
containsRect(b: Phaser.Rectangle): boolean;
43634363
copyFrom(source: any): Phaser.Rectangle;

0 commit comments

Comments
 (0)