Skip to content

Commit

Permalink
fix: error (inc = nill ) when zooming
Browse files Browse the repository at this point in the history
  • Loading branch information
piXelicidio committed Apr 1, 2018
1 parent aea315c commit 43c2e5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code/simconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

local simconfig = {

numAnts = 4600,
numAnts = 6600,
numAntsMobile = 1000,
antMaxSpeed = 1.2,
antComAlgorithm = 1, -- 0 = Nothing; 1 = Pheromones inspiration
Expand Down
5 changes: 2 additions & 3 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,8 @@ function api.mousepressed(x, y, button, istouch)
end

function api.wheelmoved( x, y)
local inc
if y>0 then inc = 0.5 end
if y<0 then inc = -0.5 end
local inc = y * 0.5

cam.zoomOrigin.x, cam.zoomOrigin.y = api.mouse.getX(), api.mouse.getY()
cam.zoom(inc)
end
Expand Down

0 comments on commit 43c2e5a

Please sign in to comment.