File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77var GetAspectRatio = require ( './GetAspectRatio' ) ;
88
9- // Fits the target rectangle into the source rectangle.
10- // Preserves aspect ratio.
11- // Scales and centers the target rectangle to the source rectangle
12-
139/**
14- * [description]
10+ * Adjusts the target rectangle, changing its width, height and position,
11+ * so that it fits inside the area of the source rectangle, while maintaining its original
12+ * aspect ratio.
13+ *
14+ * Unlike the `FitOutside` function, there may be some space inside the source area not covered.
1515 *
1616 * @function Phaser.Geom.Rectangle.FitInside
1717 * @since 3.0.0
1818 *
1919 * @generic {Phaser.Geom.Rectangle} O - [target,$return]
2020 *
21- * @param {Phaser.Geom.Rectangle } target - [description]
22- * @param {Phaser.Geom.Rectangle } source - [description]
21+ * @param {Phaser.Geom.Rectangle } target - The target rectangle to adjust.
22+ * @param {Phaser.Geom.Rectangle } source - The source rectangle to envlope the target in.
2323 *
24- * @return {Phaser.Geom.Rectangle } [description]
24+ * @return {Phaser.Geom.Rectangle } The modified target rectangle instance.
2525 */
2626var FitInside = function ( target , source )
2727{
Original file line number Diff line number Diff line change 66
77var GetAspectRatio = require ( './GetAspectRatio' ) ;
88
9- // Fits the target rectangle around the source rectangle.
10- // Preserves aspect ration.
11- // Scales and centers the target rectangle to the source rectangle
12-
139/**
14- * [description]
10+ * Adjusts the target rectangle, changing its width, height and position,
11+ * so that it fully covers the area of the source rectangle, while maintaining its original
12+ * aspect ratio.
13+ *
14+ * Unlike the `FitInside` function, the target rectangle may extend further out than the source.
1515 *
1616 * @function Phaser.Geom.Rectangle.FitOutside
1717 * @since 3.0.0
1818 *
1919 * @generic {Phaser.Geom.Rectangle} O - [target,$return]
2020 *
21- * @param {Phaser.Geom.Rectangle } target - [description]
22- * @param {Phaser.Geom.Rectangle } source - [description]
21+ * @param {Phaser.Geom.Rectangle } target - The target rectangle to adjust.
22+ * @param {Phaser.Geom.Rectangle } source - The source rectangle to envlope the target in.
2323 *
24- * @return {Phaser.Geom.Rectangle } [description]
24+ * @return {Phaser.Geom.Rectangle } The modified target rectangle instance.
2525 */
2626var FitOutside = function ( target , source )
2727{
You can’t perform that action at this time.
0 commit comments