eeschema: Cleanup processing for multiple line editing

This commit is contained in:
Ian McInerney 2020-01-03 19:30:29 +00:00
parent 20e7fc8a0e
commit 81292d2bf1
1 changed files with 7 additions and 11 deletions

View File

@ -1306,23 +1306,19 @@ int SCH_EDIT_TOOL::Properties( const TOOL_EVENT& aEvent )
case SCH_LINE_T:
{
SCH_LINE* line = static_cast<SCH_LINE*>( item );
// We purposely disallow editing everything except graphic lines
if( !line->IsGraphicLine() )
break;
if( !selection.AreAllItemsIdentical() )
break;
std::deque<SCH_LINE*> lines;
for( auto item : selection.Items() )
for( auto selItem : selection.Items() )
{
auto line = dynamic_cast<SCH_LINE*>( item );
assert( line != nullptr );
SCH_LINE* line = dynamic_cast<SCH_LINE*>( selItem );
if( line )
lines.push_back( line );
}
// Verify we are only editing graphic lines
if( !std::all_of( lines.begin(), lines.end(),
[&]( const SCH_LINE* r ) { return r->IsGraphicLine(); } ) )
break;