Browse Source

Improve encapsulation. SCH_LINE has no business knowing about drags.

pull/15/head
Jeff Young 7 years ago
parent
commit
57a491357f
  1. 19
      eeschema/sch_line.cpp
  2. 2
      eeschema/sch_line.h

19
eeschema/sch_line.cpp

@ -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();

2
eeschema/sch_line.h

@ -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;

Loading…
Cancel
Save