mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Extension snaps: don't accept empty batches
These shouldn't be bad, and probably don't actually happen, but they will act to clear extant construction lines for no new shown items, so may as well be clear that they don't do anything.
This commit is contained in:
parent
095e414f12
commit
312996f0a2
@ -212,6 +212,13 @@ HashConstructionBatchSources( const CONSTRUCTION_MANAGER::CONSTRUCTION_ITEM_BATC
|
||||
void CONSTRUCTION_MANAGER::ProposeConstructionItems( CONSTRUCTION_ITEM_BATCH aBatch,
|
||||
bool aIsPersistent )
|
||||
{
|
||||
if( aBatch.empty() )
|
||||
{
|
||||
// There's no point in proposing an empty batch
|
||||
// It would just clear existing construction items for nothing new
|
||||
return;
|
||||
}
|
||||
|
||||
const std::size_t hash = HashConstructionBatchSources( aBatch, aIsPersistent );
|
||||
|
||||
m_activationHelper->ProposeActivation(
|
||||
|
@ -270,9 +270,14 @@ void PCB_GRID_HELPER::AddConstructionItems( std::vector<BOARD_ITEM*> aItems, boo
|
||||
}
|
||||
}
|
||||
|
||||
// At this point, constructionDrawables can be empty, which is fine
|
||||
// (it means there's no additional construction geometry to draw, but
|
||||
// the item is still going to be proposed for activation)
|
||||
constructionItemsBatch.emplace_back( CONSTRUCTION_MANAGER::CONSTRUCTION_ITEM{
|
||||
CONSTRUCTION_MANAGER::SOURCE::FROM_ITEMS, item,
|
||||
std::move( constructionDrawables ) } );
|
||||
CONSTRUCTION_MANAGER::SOURCE::FROM_ITEMS,
|
||||
item,
|
||||
std::move( constructionDrawables ),
|
||||
} );
|
||||
}
|
||||
|
||||
if( referenceOnlyPoints.size() )
|
||||
|
Loading…
x
Reference in New Issue
Block a user