calculate weight when adding background