take padding into account when generating sprite map.