(Partial update) Change calculation of damaged rects