Call the component directly to avoid lots of function diving

This commit is contained in:
Richard Davey 2020-10-15 11:47:24 +01:00
parent 536f08a4bf
commit 8a01ae1cb7

View file

@ -18,6 +18,7 @@ var FuzzyGreaterThan = require('../../math/fuzzy/GreaterThan');
var FuzzyLessThan = require('../../math/fuzzy/LessThan'); var FuzzyLessThan = require('../../math/fuzzy/LessThan');
var GetOverlapX = require('./GetOverlapX'); var GetOverlapX = require('./GetOverlapX');
var GetOverlapY = require('./GetOverlapY'); var GetOverlapY = require('./GetOverlapY');
var GetTilesWithinWorldXY = require('../../tilemaps/components/GetTilesWithinWorldXY');
var GetValue = require('../../utils/object/GetValue'); var GetValue = require('../../utils/object/GetValue');
var MATH_CONST = require('../../math/const'); var MATH_CONST = require('../../math/const');
var ProcessQueue = require('../../structs/ProcessQueue'); var ProcessQueue = require('../../structs/ProcessQueue');
@ -2201,7 +2202,7 @@ var World = new Class({
h += yDiff; h += yDiff;
} }
var mapData = tilemapLayer.getTilesWithinWorldXY(x, y, w, h); var mapData = GetTilesWithinWorldXY(x, y, w, h, null, tilemapLayer.scene.cameras.main, tilemapLayer.layer);
if (mapData.length === 0) if (mapData.length === 0)
{ {
@ -2253,8 +2254,8 @@ var World = new Class({
tileWorldRect.left = point.x; tileWorldRect.left = point.x;
tileWorldRect.top = point.y; tileWorldRect.top = point.y;
// If the map's base tile size differs from the layer's tile size, only the top of the rect // If the maps base tile size differs from the layer tile size, only the top of the rect
// needs to be adjusted since its origin is (0, 1). // needs to be adjusted since its origin is (0, 1).
if (tile.baseHeight !== tile.height) if (tile.baseHeight !== tile.height)
{ {
tileWorldRect.top -= (tile.height - tile.baseHeight) * tilemapLayer.scaleY; tileWorldRect.top -= (tile.height - tile.baseHeight) * tilemapLayer.scaleY;
@ -2331,7 +2332,7 @@ var World = new Class({
* @method Phaser.Physics.Arcade.World#wrap * @method Phaser.Physics.Arcade.World#wrap
* @since 3.3.0 * @since 3.3.0
* *
* @param {*} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects. * @param {any} object - A Game Object, a Group, an object with `x` and `y` coordinates, or an array of such objects.
* @param {number} [padding=0] - An amount added to each boundary edge during the operation. * @param {number} [padding=0] - An amount added to each boundary edge during the operation.
*/ */
wrap: function (object, padding) wrap: function (object, padding)