Add detect.PadRect and associated functions