Loading include/math/box2.h +7 −5 Original line number Diff line number Diff line Loading @@ -66,7 +66,9 @@ public: BOX2( const Vec& aPos, const Vec& aSize ) : m_Pos( aPos ), m_Size( aSize ) { } { Normalize(); } void SetMaximum() { Loading Loading @@ -416,8 +418,8 @@ public: { ecoord_type x2 = m_Pos.x + m_Size.x; ecoord_type y2 = m_Pos.y + m_Size.y; ecoord_type xdiff = std::max( aP.x < m_Pos.x ? m_Pos.x - aP.x : m_Pos.x - x2, 0 ); ecoord_type ydiff = std::max( aP.y < m_Pos.y ? m_Pos.y - aP.y : m_Pos.y - y2, 0 ); ecoord_type xdiff = std::max(aP.x < m_Pos.x ? m_Pos.x - aP.x : m_Pos.x - x2, (ecoord_type)0); ecoord_type ydiff = std::max(aP.y < m_Pos.y ? m_Pos.y - aP.y : m_Pos.y - y2, (ecoord_type)0); return xdiff * xdiff + ydiff * ydiff; } Loading Loading
include/math/box2.h +7 −5 Original line number Diff line number Diff line Loading @@ -66,7 +66,9 @@ public: BOX2( const Vec& aPos, const Vec& aSize ) : m_Pos( aPos ), m_Size( aSize ) { } { Normalize(); } void SetMaximum() { Loading Loading @@ -416,8 +418,8 @@ public: { ecoord_type x2 = m_Pos.x + m_Size.x; ecoord_type y2 = m_Pos.y + m_Size.y; ecoord_type xdiff = std::max( aP.x < m_Pos.x ? m_Pos.x - aP.x : m_Pos.x - x2, 0 ); ecoord_type ydiff = std::max( aP.y < m_Pos.y ? m_Pos.y - aP.y : m_Pos.y - y2, 0 ); ecoord_type xdiff = std::max(aP.x < m_Pos.x ? m_Pos.x - aP.x : m_Pos.x - x2, (ecoord_type)0); ecoord_type ydiff = std::max(aP.y < m_Pos.y ? m_Pos.y - aP.y : m_Pos.y - y2, (ecoord_type)0); return xdiff * xdiff + ydiff * ydiff; } Loading