The scroll to is updating the position of player2's viewport every tick. Before it updates, all objects are moved the difference between player 1 and 2's positions, saved to the canvas to take a snapshot, then moved back. This all happens within a tick, so no movement is actually displayed to the user. The viewport scroll to is then updated to player2's position for the next frame.