mirror of
https://github.com/rm-code/Graphoon.git
synced 2024-11-16 18:24:22 +00:00
Add function for getting the x and y coordinates of the graph's center
This commit is contained in:
parent
6532d97cca
commit
ebb82093fb
@ -187,6 +187,13 @@ function Graph.new()
|
||||
return minX, maxX, minY, maxY;
|
||||
end
|
||||
|
||||
---
|
||||
-- Returns the x and y coordinates of the graph's center.
|
||||
--
|
||||
function self:getCenter()
|
||||
return ( ( maxX - minX ) * 0.5 ) + minX, ( ( maxY - minY ) * 0.5 ) + minY;
|
||||
end
|
||||
|
||||
return self;
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user