Added some trimming functions to Rectangle.