$sc[$i]->xviewMoveto( ($location /$initial_width ); # where I needed $sc[$i]->xviewMoveto( ($location - 400/2)/$initial_width );