Please change the function call to take x, y, width, height instead of x, y, patch_padding.  Not everyone using this function will necessarily want a square patch, and x,y are generally at the top-left for screen-pixel oriented functions.