Minor changes in EDA_RECT to facilitate python scripts
3 EDA_RECT members were returned by reference by their accessors, now they are returned by value. It avoid constraints when using them, especially when mixing Python and C++ in scripts.
This commit is contained in:
parent
480b1c2592
commit
11eb8aa098
|
@ -96,7 +96,7 @@ public:
|
||||||
*/
|
*/
|
||||||
bool Contains( const EDA_RECT& aRect ) const;
|
bool Contains( const EDA_RECT& aRect ) const;
|
||||||
|
|
||||||
const wxSize& GetSize() const { return m_Size; }
|
const wxSize GetSize() const { return m_Size; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief GetSizeMax
|
* @brief GetSizeMax
|
||||||
|
@ -107,8 +107,8 @@ public:
|
||||||
int GetX() const { return m_Pos.x; }
|
int GetX() const { return m_Pos.x; }
|
||||||
int GetY() const { return m_Pos.y; }
|
int GetY() const { return m_Pos.y; }
|
||||||
|
|
||||||
const wxPoint& GetOrigin() const { return m_Pos; }
|
const wxPoint GetOrigin() const { return m_Pos; }
|
||||||
const wxPoint& GetPosition() const { return m_Pos; }
|
const wxPoint GetPosition() const { return m_Pos; }
|
||||||
const wxPoint GetEnd() const { return wxPoint( m_Pos.x + m_Size.x, m_Pos.y + m_Size.y ); }
|
const wxPoint GetEnd() const { return wxPoint( m_Pos.x + m_Size.x, m_Pos.y + m_Size.y ); }
|
||||||
const wxPoint GetCenter() const { return wxPoint( m_Pos.x + ( m_Size.x / 2 ), m_Pos.y + ( m_Size.y / 2 ) ); }
|
const wxPoint GetCenter() const { return wxPoint( m_Pos.x + ( m_Size.x / 2 ), m_Pos.y + ( m_Size.y / 2 ) ); }
|
||||||
|
|
||||||
|
@ -124,8 +124,7 @@ public:
|
||||||
void SetSize( const wxSize& size ) { m_Size = size; }
|
void SetSize( const wxSize& size ) { m_Size = size; }
|
||||||
void SetSize( int w, int h ) { m_Size.x = w; m_Size.y = h; }
|
void SetSize( int w, int h ) { m_Size.x = w; m_Size.y = h; }
|
||||||
void Offset( int dx, int dy ) { m_Pos.x += dx; m_Pos.y += dy; }
|
void Offset( int dx, int dy ) { m_Pos.x += dx; m_Pos.y += dy; }
|
||||||
void Offset( const wxPoint& offset ) { m_Pos.x += offset.x; m_Pos.y +=
|
void Offset( const wxPoint& offset ) { m_Pos += offset; }
|
||||||
offset.y; }
|
|
||||||
void SetX( int val ) { m_Pos.x = val; }
|
void SetX( int val ) { m_Pos.x = val; }
|
||||||
void SetY( int val ) { m_Pos.y = val; }
|
void SetY( int val ) { m_Pos.y = val; }
|
||||||
void SetWidth( int val ) { m_Size.x = val; }
|
void SetWidth( int val ) { m_Size.x = val; }
|
||||||
|
@ -228,7 +227,7 @@ public:
|
||||||
{
|
{
|
||||||
EDA_RECT rect( m_Pos, m_Size );
|
EDA_RECT rect( m_Pos, m_Size );
|
||||||
rect.Normalize();
|
rect.Normalize();
|
||||||
return BOX2I( rect.GetPosition(), rect.GetEnd() );
|
return BOX2I( rect.GetOrigin(), rect.GetEnd() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue