Skip to content

Commit 7f835da

Browse files
committed
Fixed Rectangle hit area coordinates
1 parent 5b50147 commit 7f835da

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src/gameobjects/zone/Zone.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,7 @@ var Zone = new Class({
226226
*/
227227
setRectangleDropZone: function (width, height)
228228
{
229-
var x = -(width / 2);
230-
var y = -(height / 2);
231-
232-
return this.setDropZone(new Rectangle(x, y, width, height), RectangleContains);
229+
return this.setDropZone(new Rectangle(0, 0, width, height), RectangleContains);
233230
},
234231

235232
/**
@@ -249,8 +246,7 @@ var Zone = new Class({
249246
{
250247
this.setRectangleDropZone(this.width, this.height);
251248
}
252-
else
253-
if (!this.input)
249+
else if (!this.input)
254250
{
255251
this.setInteractive(shape, callback, true);
256252
}

0 commit comments

Comments
 (0)