Seeking Help in Painting the Barn

I needed help with the following problem :
Problem Link

Solution Link
In the editorial of this problem, it is given that we are adding at the starting and the ending point of the corners (x1, y1) and (x2, y2) whereas decrement the other 2 corners. Could someone please explain the logic behind this?

Thanks.

It’s the same concept. Basically, the points given are coordinates.