Commit de637d2b authored by Maciej Suminski's avatar Maciej Suminski

Fixed a missing group clearing and update for restored VIEW_ITEMs.Fixed a...

Fixed a missing group clearing and update for restored VIEW_ITEMs.Fixed a missing group clearing and update for restored VIEW_ITEMs.
parent 1c253bfb
...@@ -94,13 +94,16 @@ void VIEW::Add( VIEW_ITEM* aItem ) ...@@ -94,13 +94,16 @@ void VIEW::Add( VIEW_ITEM* aItem )
aItem->ViewGetLayers( layers, layers_count ); aItem->ViewGetLayers( layers, layers_count );
aItem->saveLayers( layers, layers_count ); aItem->saveLayers( layers, layers_count );
for( int i = 0; i < layers_count; i++ ) for( int i = 0; i < layers_count; ++i )
{ {
VIEW_LAYER& l = m_layers[layers[i]]; VIEW_LAYER& l = m_layers[layers[i]];
l.items->Insert( aItem ); l.items->Insert( aItem );
MarkTargetDirty( l.target ); MarkTargetDirty( l.target );
} }
if( aItem->viewRequiredUpdate() != VIEW_ITEM::NONE )
MarkForUpdate( aItem );
if( m_dynamic ) if( m_dynamic )
aItem->viewAssign( this ); aItem->viewAssign( this );
} }
...@@ -122,8 +125,12 @@ void VIEW::Remove( VIEW_ITEM* aItem ) ...@@ -122,8 +125,12 @@ void VIEW::Remove( VIEW_ITEM* aItem )
// Clear the GAL cache // Clear the GAL cache
int prevGroup = aItem->getGroup( layers[i] ); int prevGroup = aItem->getGroup( layers[i] );
if( prevGroup >= 0 ) if( prevGroup >= 0 )
{
m_gal->DeleteGroup( prevGroup ); m_gal->DeleteGroup( prevGroup );
aItem->setGroup( layers[i], -1 );
}
} }
} }
...@@ -134,13 +141,9 @@ void VIEW::SetRequired( int aLayerId, int aRequiredId, bool aRequired ) ...@@ -134,13 +141,9 @@ void VIEW::SetRequired( int aLayerId, int aRequiredId, bool aRequired )
wxASSERT( (unsigned) aRequiredId < m_layers.size() ); wxASSERT( (unsigned) aRequiredId < m_layers.size() );
if( aRequired ) if( aRequired )
{
m_layers[aLayerId].requiredLayers.insert( aRequiredId ); m_layers[aLayerId].requiredLayers.insert( aRequiredId );
}
else else
{
m_layers[aLayerId].requiredLayers.erase( aRequired ); m_layers[aLayerId].requiredLayers.erase( aRequired );
}
} }
...@@ -781,11 +784,8 @@ struct VIEW::clearLayerCache ...@@ -781,11 +784,8 @@ struct VIEW::clearLayerCache
} }
bool operator()( VIEW_ITEM* aItem ) bool operator()( VIEW_ITEM* aItem )
{
if( aItem->storesGroups() )
{ {
aItem->deleteGroups(); aItem->deleteGroups();
}
return true; return true;
} }
......
...@@ -275,10 +275,6 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) ...@@ -275,10 +275,6 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer )
if( length < 10 * width ) if( length < 10 * width )
return; return;
NETINFO_ITEM* net = ( (BOARD*) aTrack->GetParent() )->FindNet( netNumber );
if( !net )
return;
const wxString& netName = aTrack->GetShortNetname(); const wxString& netName = aTrack->GetShortNetname();
VECTOR2D textPosition = start + line / 2.0; // center of the track VECTOR2D textPosition = start + line / 2.0; // center of the track
double textOrientation = -atan( line.y / line.x ); double textOrientation = -atan( line.y / line.x );
...@@ -303,7 +299,7 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) ...@@ -303,7 +299,7 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer )
m_gal->StrokeText( netName, textPosition, textOrientation ); m_gal->StrokeText( netName, textPosition, textOrientation );
} }
} }
else if( IsCopperLayer( aLayer )) else if( IsCopperLayer( aLayer ) )
{ {
// Draw a regular track // Draw a regular track
const COLOR4D& color = m_pcbSettings->GetColor( aTrack, aLayer ); const COLOR4D& color = m_pcbSettings->GetColor( aTrack, aLayer );
......
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