Skip to content

Commit 638d72a

Browse files
committed
Use upvalues
1 parent 65d78b3 commit 638d72a

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

Graphoon/Graph.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,10 @@ function Graph.new()
3636
---
3737
-- Updates the boundaries of the graph.
3838
-- This represents the rectangular area in which all nodes are contained.
39-
-- @param minX - The current minimum x position.
40-
-- @param maxX - The current maximum y position.
41-
-- @param minY - The current minimum x position.
42-
-- @param maxY - The current maximum y position.
4339
-- @param nx - The new x position to check.
4440
-- @param ny - The new y position to check.
4541
--
46-
local function updateBoundaries( minX, maxX, minY, maxY, nx, ny )
42+
local function updateBoundaries( nx, ny )
4743
return math.min( minX or nx, nx ), math.max( maxX or nx, nx ), math.min( minY or ny, ny ), math.max( maxY or ny, ny );
4844
end
4945

@@ -158,7 +154,7 @@ function Graph.new()
158154
nodeCallback( nodeA );
159155
end
160156

161-
minX, maxX, minY, maxY = updateBoundaries( minX, maxX, minY, maxY, nodeA:getPosition() );
157+
minX, maxX, minY, maxY = updateBoundaries( nodeA:getPosition() );
162158
end
163159
end
164160

0 commit comments

Comments
 (0)