Speed improvement for select / deselect in GAL
- No longer invalidates the item layers - For multiple items, this results in a drastic speed improvement
This commit is contained in:
parent
c27f5b725d
commit
161045f17d
|
@ -1081,9 +1081,13 @@ 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
|
// updateLayers updates geometry too, so we do not have to update both of them at the same time
|
||||||
if( aUpdateFlags & LAYERS )
|
if( aUpdateFlags & LAYERS )
|
||||||
|
{
|
||||||
updateLayers( aItem );
|
updateLayers( aItem );
|
||||||
|
}
|
||||||
else if( aUpdateFlags & GEOMETRY )
|
else if( aUpdateFlags & GEOMETRY )
|
||||||
|
{
|
||||||
updateBbox( aItem );
|
updateBbox( aItem );
|
||||||
|
}
|
||||||
|
|
||||||
int layers[VIEW_MAX_LAYERS], layers_count;
|
int layers[VIEW_MAX_LAYERS], layers_count;
|
||||||
aItem->ViewGetLayers( layers, layers_count );
|
aItem->ViewGetLayers( layers, layers_count );
|
||||||
|
|
|
@ -426,7 +426,9 @@ bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag )
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if( !m_additive && anyCollected )
|
if( !m_additive && anyCollected )
|
||||||
|
{
|
||||||
clearSelection();
|
clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -449,7 +451,9 @@ bool SELECTION_TOOL::selectPoint( const VECTOR2I& aWhere, bool aOnDrag )
|
||||||
else if( collector.GetCount() > 1 )
|
else if( collector.GetCount() > 1 )
|
||||||
{
|
{
|
||||||
if( aOnDrag )
|
if( aOnDrag )
|
||||||
|
{
|
||||||
Wait( TOOL_EVENT( TC_ANY, TA_MOUSE_UP, BUT_LEFT ) );
|
Wait( TOOL_EVENT( TC_ANY, TA_MOUSE_UP, BUT_LEFT ) );
|
||||||
|
}
|
||||||
|
|
||||||
item = disambiguationMenu( &collector );
|
item = disambiguationMenu( &collector );
|
||||||
|
|
||||||
|
@ -1517,7 +1521,7 @@ void SELECTION_TOOL::selectVisually( BOARD_ITEM* aItem )
|
||||||
// Hide the original item, so it is shown only on overlay
|
// Hide the original item, so it is shown only on overlay
|
||||||
aItem->SetSelected();
|
aItem->SetSelected();
|
||||||
view()->Hide( aItem, true );
|
view()->Hide( aItem, true );
|
||||||
view()->Update( aItem, KIGFX::GEOMETRY );
|
view()->Update( aItem, KIGFX::COLOR );
|
||||||
|
|
||||||
// Modules are treated in a special way - when they are selected, we have to
|
// Modules are treated in a special way - when they are selected, we have to
|
||||||
// unselect all the parts that make the module, not the module itself
|
// unselect all the parts that make the module, not the module itself
|
||||||
|
@ -1528,8 +1532,8 @@ void SELECTION_TOOL::selectVisually( BOARD_ITEM* aItem )
|
||||||
{
|
{
|
||||||
item->SetSelected();
|
item->SetSelected();
|
||||||
view()->Hide( item, true );
|
view()->Hide( item, true );
|
||||||
view()->Update( item, KIGFX::GEOMETRY );
|
view()->Update( item, KIGFX::COLOR );
|
||||||
} );
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
view()->Update( &m_selection );
|
view()->Update( &m_selection );
|
||||||
|
@ -1541,7 +1545,7 @@ void SELECTION_TOOL::unselectVisually( BOARD_ITEM* aItem )
|
||||||
// Restore original item visibility
|
// Restore original item visibility
|
||||||
aItem->ClearSelected();
|
aItem->ClearSelected();
|
||||||
view()->Hide( aItem, false );
|
view()->Hide( aItem, false );
|
||||||
view()->Update( aItem, KIGFX::ALL );
|
view()->Update( aItem, KIGFX::COLOR );
|
||||||
|
|
||||||
// Modules are treated in a special way - when they are selected, we have to
|
// Modules are treated in a special way - when they are selected, we have to
|
||||||
// unselect all the parts that make the module, not the module itself
|
// unselect all the parts that make the module, not the module itself
|
||||||
|
@ -1552,7 +1556,7 @@ void SELECTION_TOOL::unselectVisually( BOARD_ITEM* aItem )
|
||||||
{
|
{
|
||||||
item->ClearSelected();
|
item->ClearSelected();
|
||||||
view()->Hide( item, false );
|
view()->Hide( item, false );
|
||||||
view()->Update( item, KIGFX::ALL );
|
view()->Update( item, KIGFX::COLOR );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue