adjust center point based on viewport