Change how Rectangles are printed, special case for EMPTY

Change-Id: I0fe230875e785b811ae09e04399790a53b354dd6
This commit is contained in:
Tor Lillqvist 2013-03-25 12:38:24 +02:00
parent 74fa38afcd
commit f222e81cb8

View file

@ -679,8 +679,11 @@ template< typename charT, typename traits >
inline std::basic_ostream<charT, traits> & operator <<(
std::basic_ostream<charT, traits> & stream, const Rectangle& rectangle )
{
return stream << rectangle.getX() << ',' << rectangle.getY() << ' '
<< rectangle.getWidth() << 'x' << rectangle.getHeight();
if (rectangle.IsEmpty())
return stream << "EMPTY";
else
return stream << rectangle.getWidth() << 'x' << rectangle.getHeight()
<< "@(" << rectangle.getX() << ',' << rectangle.getY() << ")";
}
#endif