gears.geometry: Make area_intersect_area() public
This commit is contained in:
parent
dd3658bb1c
commit
da418b56ab
|
@ -151,7 +151,7 @@ end
|
||||||
-- @param a The area.
|
-- @param a The area.
|
||||||
-- @param b The other area.
|
-- @param b The other area.
|
||||||
-- @return True if they intersect, false otherwise.
|
-- @return True if they intersect, false otherwise.
|
||||||
local function area_intersect_area(a, b)
|
function gears.geometry.rectangle.area_intersect_area(a, b)
|
||||||
return (b.x < a.x + a.width
|
return (b.x < a.x + a.width
|
||||||
and b.x + b.width > a.x
|
and b.x + b.width > a.x
|
||||||
and b.y < a.y + a.height
|
and b.y < a.y + a.height
|
||||||
|
@ -194,7 +194,7 @@ end
|
||||||
function gears.geometry.rectangle.area_remove(areas, elem)
|
function gears.geometry.rectangle.area_remove(areas, elem)
|
||||||
for i = #areas, 1, -1 do
|
for i = #areas, 1, -1 do
|
||||||
-- Check if the 'elem' intersect
|
-- Check if the 'elem' intersect
|
||||||
if area_intersect_area(areas[i], elem) then
|
if gears.geometry.rectangle.area_intersect_area(areas[i], elem) then
|
||||||
-- It does? remove it
|
-- It does? remove it
|
||||||
local r = table.remove(areas, i)
|
local r = table.remove(areas, i)
|
||||||
local inter = gears.geometry.rectangle.get_intersection(r, elem)
|
local inter = gears.geometry.rectangle.get_intersection(r, elem)
|
||||||
|
|
Loading…
Reference in New Issue