Make sure bounding box is not degenerate.
This commit is contained in:
parent
efa14e501c
commit
5507748fa9
|
@ -190,14 +190,13 @@ void SCH_LINE::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
|
||||
const BOX2I SCH_LINE::GetBoundingBox() const
|
||||
{
|
||||
int width = m_stroke.GetWidth() / 2;
|
||||
int extra = m_stroke.GetWidth() & 0x1;
|
||||
int width = GetPenWidth() / 2;
|
||||
|
||||
int xmin = std::min( m_start.x, m_end.x ) - width;
|
||||
int ymin = std::min( m_start.y, m_end.y ) - width;
|
||||
|
||||
int xmax = std::max( m_start.x, m_end.x ) + width + extra;
|
||||
int ymax = std::max( m_start.y, m_end.y ) + width + extra;
|
||||
int xmax = std::max( m_start.x, m_end.x ) + width + 1;
|
||||
int ymax = std::max( m_start.y, m_end.y ) + width + 1;
|
||||
|
||||
BOX2I ret( VECTOR2I( xmin, ymin ), VECTOR2I( xmax - xmin, ymax - ymin ) );
|
||||
|
||||
|
|
Loading…
Reference in New Issue