Commit 08fd9d8c authored by Maciej Suminski's avatar Maciej Suminski

Overridden ViewUpdate() for MODULE class, so it handles its pads, drawings and texts.

parent 4876dbea
......@@ -819,7 +819,7 @@ void VIEW::clearGroupCache()
}
void VIEW::invalidateItem( VIEW_ITEM* aItem, int aUpdateFlags )
void VIEW::InvalidateItem( VIEW_ITEM* aItem, int aUpdateFlags )
{
// updateLayers updates geometry too, so we do not have to update both of them at the same time
if( aUpdateFlags & VIEW_ITEM::LAYERS )
......
......@@ -53,7 +53,7 @@ void VIEW_ITEM::ViewUpdate( int aUpdateFlags )
if( !m_view )
return;
m_view->invalidateItem( this, aUpdateFlags );
m_view->InvalidateItem( this, aUpdateFlags );
}
......
......@@ -493,6 +493,14 @@ public:
m_scaleLimits = VECTOR2D( aMaximum, aMinimum );
}
/**
* Function InvalidateItem()
* Manages dirty flags & redraw queueing when updating an item.
* @param aItem is the item to be updated.
* @param aUpdateFlags determines the way an item is refreshed.
*/
void InvalidateItem( VIEW_ITEM* aItem, int aUpdateFlags );
static const int VIEW_MAX_LAYERS = 128; ///* maximum number of layers that may be shown
private:
......@@ -563,11 +571,6 @@ private:
*/
void draw( VIEW_GROUP* aGroup, bool aImmediate = false ) const;
///* Manages dirty flags & redraw queueing when updating an item. Called internally
/// via VIEW_ITEM::ViewUpdate()
void invalidateItem( VIEW_ITEM* aItem, int aUpdateFlags );
///* Sorts m_orderedLayers when layer rendering order has changed
void sortLayers();
......
......@@ -728,6 +728,28 @@ EDA_ITEM* MODULE::Clone() const
}
void MODULE::ViewUpdate( int aUpdateFlags )
{
if( !m_view )
return;
// Update pads
for( D_PAD* pad = m_Pads.GetFirst(); pad; pad = pad->Next() )
m_view->InvalidateItem( pad, aUpdateFlags );
// Update module's drawing (mostly silkscreen)
for( BOARD_ITEM* drawing = m_Drawings.GetFirst(); drawing; drawing = drawing->Next() )
m_view->InvalidateItem( drawing, aUpdateFlags );
// Update module's texts
m_view->InvalidateItem( m_Reference, aUpdateFlags );
m_view->InvalidateItem( m_Value, aUpdateFlags );
// Update the module itself
m_view->InvalidateItem( this, aUpdateFlags );
}
/* Test for validity of the name in a library of the footprint
* ( no spaces, dir separators ... )
* return true if the given name is valid
......
......@@ -447,6 +447,9 @@ public:
EDA_ITEM* Clone() const;
/// @copydoc VIEW_ITEM::ViewUpdate()
void ViewUpdate( int aUpdateFlags );
/**
* Function CopyNetlistSettings
* copies the netlist settings to \a aModule.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment