Fixed bounding box for module texts.

This commit is contained in:
Maciej Suminski 2014-01-07 14:09:27 +01:00
parent 537d82fb98
commit 7784365b39
2 changed files with 15 additions and 0 deletions

View File

@ -415,6 +415,18 @@ EDA_ITEM* TEXTE_MODULE::Clone() const
}
const BOX2I TEXTE_MODULE::ViewBBox() const
{
double angle = GetDrawRotation();
EDA_RECT text_area = GetTextBox( -1, -1 );
if( angle )
text_area = text_area.GetBoundingBoxRotated( m_Pos, angle );
return BOX2I( text_area.GetPosition(), text_area.GetSize() );
}
void TEXTE_MODULE::ViewGetLayers( int aLayers[], int& aCount ) const
{
switch( m_Type )

View File

@ -165,6 +165,9 @@ public:
EDA_ITEM* Clone() const;
/// @copydoc VIEW_ITEM::ViewBBox()
virtual const BOX2I ViewBBox() const;
/// @copydoc VIEW_ITEM::ViewGetLayers()
virtual void ViewGetLayers( int aLayers[], int& aCount ) const;