From dc61567454a36901c091314de6bc9c8a99097451 Mon Sep 17 00:00:00 2001 From: vieron Date: Sat, 8 Sep 2012 13:58:47 +0200 Subject: [PATCH] collision: ignore min_area in collision sorting This doesn't work with grids with small values in widget_base_dimensions and widget_margins options. --- src/jquery.collision.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/jquery.collision.js b/src/jquery.collision.js index 5d37c614f..097e7bd14 100644 --- a/src/jquery.collision.js +++ b/src/jquery.collision.js @@ -188,12 +188,8 @@ fn.get_closest_colliders = function(player_data_coords){ var colliders = this.find_collisions(player_data_coords); - var min_area = 100; - colliders.sort(function(a, b){ - if (a.area <= min_area) { - return 1; - } + colliders.sort(function(a, b) { /* if colliders are being overlapped by the "C" (center) region, * we have to set a lower index in the array to which they are placed * above in the grid. */ @@ -205,7 +201,7 @@ } } - if (a.area < b.area){ + if (a.area < b.area) { return 1; }