Adjustments to fix panning feature so that the window dimensions do not change.