box2d operator<< - output "box2d(INVALID)" for invalid box.
This commit is contained in:
parent
a8b8f2e001
commit
cdeb806371
1 changed files with 10 additions and 3 deletions
|
@ -372,9 +372,16 @@ template <typename T>
|
||||||
std::string box2d<T>::to_string() const
|
std::string box2d<T>::to_string() const
|
||||||
{
|
{
|
||||||
std::ostringstream s;
|
std::ostringstream s;
|
||||||
s << "box2d(" << std::fixed << std::setprecision(16)
|
if (valid())
|
||||||
<< minx_ << ',' << miny_ << ','
|
{
|
||||||
<< maxx_ << ',' << maxy_ << ')';
|
s << "box2d(" << std::fixed << std::setprecision(16)
|
||||||
|
<< minx_ << ',' << miny_ << ','
|
||||||
|
<< maxx_ << ',' << maxy_ << ')';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s << "box2d(INVALID)";
|
||||||
|
}
|
||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue