Minor cleanup and removal of stale comments.

Also attempts to fix a focus-loss bug on GTK after zone dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/13221

(cherry picked from commit 3f26b29aa2)
This commit is contained in:
Jeff Young 2023-08-27 10:52:02 +01:00
parent 7673f220a9
commit 7d409b9404
2 changed files with 14 additions and 8 deletions

View File

@ -2638,9 +2638,10 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
}
else
{
m_frame->PopTool( aEvent );
// We've handled the cancel event. Don't cancel other tools
evt->SetPassEvent( false );
m_frame->PopTool( aEvent );
break;
}
}

View File

@ -125,19 +125,16 @@ std::unique_ptr<ZONE> ZONE_CREATE_HELPER::createNewZone( bool aKeepout )
if( m_params.m_keepout )
dialogResult = InvokeRuleAreaEditor( frame, &zoneInfo );
else
{
// TODO(JE) combine these dialogs?
if( ( zoneInfo.m_Layers & LSET::AllCuMask() ).any() )
else if( ( zoneInfo.m_Layers & LSET::AllCuMask() ).any() )
dialogResult = InvokeCopperZonesEditor( frame, &zoneInfo );
else
dialogResult = InvokeNonCopperZonesEditor( frame, &zoneInfo );
}
if( dialogResult == wxID_CANCEL )
return nullptr;
controls->WarpMouseCursor( controls->GetCursorPosition(), true );
frame->GetCanvas()->SetFocus();
}
// The new zone is a ZONE if created in the board editor and a FP_ZONE if created in the
@ -307,6 +304,14 @@ bool ZONE_CREATE_HELPER::OnFirstPoint( POLYGON_GEOM_MANAGER& aMgr )
void ZONE_CREATE_HELPER::OnGeometryChange( const POLYGON_GEOM_MANAGER& aMgr )
{
// Handle a cancel-interactive
if( m_zone && !aMgr.IsPolygonInProgress() )
{
m_zone = nullptr;
m_parentView.SetVisible( &m_previewItem, false );
return;
}
// send the points to the preview item
m_previewItem.SetPoints( aMgr.GetLockedInPoints(), aMgr.GetLeaderLinePoints(),
aMgr.GetLoopLinePoints() );