Skip to content

Commit 32440cb

Browse files
committed
Defaults to renderer aspect ratio to help with issues like phaserjs#5444
1 parent af665ed commit 32440cb

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/gameobjects/mesh/Mesh.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,9 @@ var Mesh = new Class({
458458
*
459459
* If using this mode you will often need to set `Mesh.hideCCW` to `false` as well.
460460
*
461+
* By default, calling this method with no parameters will set the scaleX value to
462+
* match the renderers aspect ratio.
463+
*
461464
* See also `setPerspective`.
462465
*
463466
* @method Phaser.GameObjects.Mesh#setOrtho
@@ -470,7 +473,7 @@ var Mesh = new Class({
470473
*/
471474
setOrtho: function (scaleX, scaleY, near, far)
472475
{
473-
if (scaleX === undefined) { scaleX = 1; }
476+
if (scaleX === undefined) { scaleX = this.scene.sys.renderer.getAspectRatio(); }
474477
if (scaleY === undefined) { scaleY = 1; }
475478
if (near === undefined) { near = -1000; }
476479
if (far === undefined) { far = 1000; }

0 commit comments

Comments
 (0)