Rect class usability improvements
The class GenericRect
is enhanced with the member function shrinkBy()
(with two overloads mirroring those of expandBy()
),
but with opposite meaning – they reduce the size of the rectangle by shaving off a "margin" of specified thickness along its perimeter.
The derived class Rect
is enhanced with member functions expandedBy()
and shrunkBy()
.
These functions are analogous to expandBy()
and shrinkBy()
but they return a new Rect
instead of modifying the current object in place.