Modified panning

Wrong bracket in dpi variable
Changed implementation of MouseDragged