on.mouse_wheel_move = function(dx, dy) if App.shift_down() then -- shift+scroll wheel doesn't set dx for me; manually do so if necessary if dx == 0 then dx,dy = dy,dx end end local v = Viewport if love.keyboard.isDown('lctrl') or love.keyboard.isDown('rctrl') then local oldzoom = v.zoom if dy < 0 and v.zoom > 0.2 then v.zoom = v.zoom - 0.1 elseif dy > 0 then v.zoom = v.zoom + 0.1 end local mx, my = love.mouse.getPosition() v.x = v.x + mx/oldzoom - mx/v.zoom v.y = v.y + my/oldzoom - my/v.zoom else v.x = v.x - dx * scale(500) v.y = v.y - dy * scale(200) end B() end