Pcbnew: point editor: minor tidy ups now everything is a behavior

This commit is contained in:
John Beard
2024-11-03 06:00:39 +08:00
parent 1e587b15ae
commit cd8ae3afd1
+9 -7
View File
@@ -2670,16 +2670,20 @@ int PCB_POINT_EDITOR::movePoint( const TOOL_EVENT& aEvent )
void PCB_POINT_EDITOR::updateItem( BOARD_COMMIT* aCommit )
{
wxCHECK( m_editPoints, /* void */ );
EDA_ITEM* item = m_editPoints->GetParent();
if( !item )
if( !item || !m_editorBehavior )
return;
if( m_editorBehavior )
{
wxCHECK( m_editedPoint, /* void */ );
m_editorBehavior->UpdateItem( *m_editedPoint, *m_editPoints );
}
// Perform any post-edit actions that the item may require
switch( item->Type() )
{
case PCB_TEXTBOX_T:
@@ -2751,13 +2755,11 @@ void PCB_POINT_EDITOR::updatePoints()
if( !item )
return;
if( m_editorBehavior )
{
// If we have an editor behavior, let it handle the update
m_editorBehavior->UpdatePoints( *m_editPoints );
getView()->Update( m_editPoints.get() );
if( !m_editorBehavior )
return;
}
m_editorBehavior->UpdatePoints( *m_editPoints );
getView()->Update( m_editPoints.get() );
}