It was a local quick and dirty fix to support negative offsets, that somehow snuck in upstream.

Also, I just read the comment for this function, and realized that the min and max values should include the whole visible area of the sprite, not just the bounding box, so this is very wrong.