Before, the image center was used, which would cause a jump if the viewport was changed before. Fixes #392