Math.max(Math.max(right,pt.x) - myTopLeft.x, mySize.width);

I know the Math.max in the parenthesis takes the larger value (either right or pt.x) but I'm confused after that.

Are we taking the larger value between myTopLeft.x and mySize.width and then minusing the larger value from either right or pt.x?