66
77/**
88* Creates a new Line object with a start and an end point.
9- *
9+ *
1010* @class Phaser.Line
1111* @constructor
1212* @param {number } [x1=0] - The x coordinate of the start of the line.
@@ -43,7 +43,7 @@ Phaser.Line.prototype = {
4343
4444 /**
4545 * Sets the components of the Line to the specified values.
46- *
46+ *
4747 * @method Phaser.Line#setTo
4848 * @param {number } [x1=0] - The x coordinate of the start of the line.
4949 * @param {number } [y1=0] - The y coordinate of the start of the line.
@@ -63,7 +63,7 @@ Phaser.Line.prototype = {
6363 /**
6464 * Sets the line to match the x/y coordinates of the two given sprites.
6565 * Can optionally be calculated from their center coordinates.
66- *
66+ *
6767 * @method Phaser.Line#fromSprite
6868 * @param {Phaser.Sprite } startSprite - The coordinates of this Sprite will be set to the Line.start point.
6969 * @param {Phaser.Sprite } endSprite - The coordinates of this Sprite will be set to the Line.start point.
@@ -85,7 +85,7 @@ Phaser.Line.prototype = {
8585
8686 /**
8787 * Sets this line to start at the given `x` and `y` coordinates and for the segment to extend at `angle` for the given `length`.
88- *
88+ *
8989 * @method Phaser.Line#fromAngle
9090 * @param {number } x - The x coordinate of the start of the line.
9191 * @param {number } y - The y coordinate of the start of the line.
@@ -104,12 +104,12 @@ Phaser.Line.prototype = {
104104
105105 /**
106106 * Rotates the line by the amount specified in `angle`.
107- *
107+ *
108108 * Rotation takes place from the center of the line.
109109 * If you wish to rotate around a different point see Line.rotateAround.
110- *
110+ *
111111 * If you wish to rotate the ends of the Line then see Line.start.rotate or Line.end.rotate.
112- *
112+ *
113113 * @method Phaser.Line#rotate
114114 * @param {number } angle - The angle in radians (unless asDegrees is true) to rotate the line by.
115115 * @param {boolean } [asDegrees=false] - Is the given angle in radians (false) or degrees (true)?
@@ -129,9 +129,9 @@ Phaser.Line.prototype = {
129129
130130 /**
131131 * Rotates the line by the amount specified in `angle`.
132- *
132+ *
133133 * Rotation takes place around the coordinates given.
134- *
134+ *
135135 * @method Phaser.Line#rotateAround
136136 * @param {number } x - The x coordinate to offset the rotation from.
137137 * @param {number } y - The y coordinate to offset the rotation from.
@@ -181,7 +181,7 @@ Phaser.Line.prototype = {
181181
182182 /**
183183 * Returns a Point object where the x and y values correspond to the center (or midpoint) of the Line segment.
184- *
184+ *
185185 * @method Phaser.Line#midPoint
186186 * @param {Phaser.Point } [out] - A Phaser.Point object into which the result will be populated. If not given a new Point object is created.
187187 * @return {Phaser.Point } A Phaser.Point object with the x and y values set to the center of the line segment.
@@ -199,10 +199,10 @@ Phaser.Line.prototype = {
199199
200200 /**
201201 * Centers this Line on the given coordinates.
202- *
202+ *
203203 * The line is centered by positioning the start and end points so that the lines midpoint matches
204204 * the coordinates given.
205- *
205+ *
206206 * @method Phaser.Line#centerOn
207207 * @param {number } x - The x position to center the line on.
208208 * @param {number } y - The y position to center the line on.
@@ -223,7 +223,7 @@ Phaser.Line.prototype = {
223223
224224 /**
225225 * Tests if the given coordinates fall on this line. See pointOnSegment to test against just the line segment.
226- *
226+ *
227227 * @method Phaser.Line#pointOnLine
228228 * @param {number } x - The line to check against this one.
229229 * @param {number } y - The line to check against this one.
@@ -237,7 +237,7 @@ Phaser.Line.prototype = {
237237
238238 /**
239239 * Tests if the given coordinates fall on this line and within the segment. See pointOnLine to test against just the line.
240- *
240+ *
241241 * @method Phaser.Line#pointOnSegment
242242 * @param {number } x - The line to check against this one.
243243 * @param {number } y - The line to check against this one.
@@ -256,7 +256,7 @@ Phaser.Line.prototype = {
256256
257257 /**
258258 * Picks a random point from anywhere on the Line segment and returns it.
259- *
259+ *
260260 * @method Phaser.Line#random
261261 * @param {Phaser.Point|object } [out] - A Phaser.Point, or any object with public x/y properties, that the values will be set in.
262262 * If no object is provided a new Phaser.Point object will be created. In high performance areas avoid this by re-using an object.
@@ -630,12 +630,12 @@ Phaser.Line.intersects = function (a, b, asSegment, result) {
630630/**
631631* Checks for intersection between the Line and a Rectangle shape, or a rectangle-like
632632* object, with public `x`, `y`, `right` and `bottom` properties, such as a Sprite or Body.
633- *
633+ *
634634* An intersection is considered valid if:
635- *
635+ *
636636* The line starts within, or ends within, the Rectangle.
637637* The line segment intersects one of the 4 rectangle edges.
638- *
638+ *
639639* The for the purposes of this function rectangles are considered 'solid'.
640640*
641641* @method intersectsRectangle
@@ -667,7 +667,7 @@ Phaser.Line.intersectsRectangle = function (line, rect) {
667667 // If the start or end of the line is inside the rect then we assume
668668 // collision, as rects are solid for our use-case.
669669
670- if ( ( x1 >= bx1 && x1 <= bx2 && y1 >= by1 && y1 <= by2 ) ||
670+ if ( ( x1 >= bx1 && x1 <= bx2 && y1 >= by1 && y1 <= by2 ) ||
671671 ( x2 >= bx1 && x2 <= bx2 && y2 >= by1 && y2 <= by2 ) )
672672 {
673673 return true ;
0 commit comments