Fix SCH_LINE::GetBoundingBox()
Instead of returning a fixed line width that was rather large, we use the actual line width
This commit is contained in:
parent
4378290094
commit
2321da702f
|
@ -201,16 +201,16 @@ void SCH_LINE::ViewGetLayers( int aLayers[], int& aCount ) const
|
|||
|
||||
const EDA_RECT SCH_LINE::GetBoundingBox() const
|
||||
{
|
||||
int width = 25;
|
||||
int width = m_size / 2;
|
||||
int extra = m_size & 0x1;
|
||||
|
||||
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;
|
||||
int ymax = std::max( 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;
|
||||
|
||||
// return a rectangle which is [pos,dim) in nature. therefore the +1
|
||||
EDA_RECT ret( wxPoint( xmin, ymin ), wxSize( xmax - xmin + 1, ymax - ymin + 1 ) );
|
||||
EDA_RECT ret( wxPoint( xmin, ymin ), wxSize( xmax - xmin, ymax - ymin ) );
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -815,4 +815,4 @@ void SCH_LINE::GetMsgPanelInfo( EDA_UNITS aUnits, MSG_PANEL_ITEMS& aList )
|
|||
bool SCH_LINE::IsGraphicLine() const
|
||||
{
|
||||
return ( GetLayer() == LAYER_NOTES );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue