Improve encapsulation. SCH_LINE has no business knowing about drags.

This commit is contained in:
Jeff Young 2019-04-27 13:09:04 +01:00
parent eacc3e67a5
commit 57a491357f
2 changed files with 19 additions and 2 deletions

View File

@ -156,13 +156,28 @@ int SCH_LINE::GetLineStyleInternalId( const wxString& aStyleName )
void SCH_LINE::Move( const wxPoint& aOffset )
{
if( (m_Flags & STARTPOINT) == 0 && aOffset != wxPoint( 0, 0 ) )
if( aOffset != wxPoint( 0, 0 ) )
{
m_start += aOffset;
m_end += aOffset;
SetModified();
}
}
void SCH_LINE::MoveStart( const wxPoint& aOffset )
{
if( aOffset != wxPoint( 0, 0 ) )
{
m_start += aOffset;
SetModified();
}
}
if( (m_Flags & ENDPOINT) == 0 && aOffset != wxPoint( 0, 0 ) )
void SCH_LINE::MoveEnd( const wxPoint& aOffset )
{
if( aOffset != wxPoint( 0, 0 ) )
{
m_end += aOffset;
SetModified();

View File

@ -122,6 +122,8 @@ public:
int GetPenSize() const override;
void Move( const wxPoint& aMoveVector ) override;
void MoveStart( const wxPoint& aMoveVector );
void MoveEnd( const wxPoint& aMoveVector );
void MirrorX( int aXaxis_position ) override;