Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Add zooming via mouse wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
rm-code committed Dec 13, 2015
1 parent b9bfc75 commit 21220d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/screens/MainScreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ function MainScreen.new()
end

function self:wheelmoved(x, y)
filePanel:wheelmoved(x, y);
local mx, my = love.mouse.getPosition();
if filePanel:intersects(mx, my) then
filePanel:wheelmoved(x, y);
else
camera:zoom(love.timer.getDelta(), y);
end
end

function self:resize(nx, ny)
Expand Down

0 comments on commit 21220d3

Please sign in to comment.