Skip to content

Commit 30e9699

Browse files
committed
Zone.setSize now has a resizeInput argument (re: phaserjs#3124)
1 parent 7959656 commit 30e9699

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

v3/src/gameobjects/zone/Zone.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,19 @@ var Zone = new Class({
7474

7575
},
7676

77-
setSize: function (width, height)
77+
setSize: function (width, height, resizeInput)
7878
{
79+
if (resizeInput === undefined) { resizeInput = true; }
80+
7981
this.width = width;
8082
this.height = height;
8183

84+
if (resizeInput && this.input && this.input.hitArea instanceof Rectangle)
85+
{
86+
this.input.hitArea.width = width;
87+
this.input.hitArea.height = height;
88+
}
89+
8290
return this;
8391
},
8492

0 commit comments

Comments
 (0)