box2: fix bug in SetMaximum()
When setting the maximum represented box, std::numerical_limits::min returns the most negative number only for integers. For floating point, it returns the smallest positive number. std::numerical_limits::lowest is the same as min for integers but returns the most negative number for floating point as well.
This commit is contained in:
parent
a1ef441dd9
commit
a552b4ccca
|
@ -60,7 +60,7 @@ public:
|
||||||
|
|
||||||
void SetMaximum()
|
void SetMaximum()
|
||||||
{
|
{
|
||||||
m_Pos.x = m_Pos.y = coord_limits::min() / 2 + coord_limits::epsilon();
|
m_Pos.x = m_Pos.y = coord_limits::lowest() / 2 + coord_limits::epsilon();
|
||||||
m_Size.x = m_Size.y = coord_limits::max() - coord_limits::epsilon();
|
m_Size.x = m_Size.y = coord_limits::max() - coord_limits::epsilon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue